Esempio n. 1
0
 /** Gets list of tokens (as Vector of Strings). */
 public Vector getElements() {
   Vector elements = new Vector();
   Parser par = new Parser(value);
   char[] delim = {','};
   while (par.hasMore()) {
     String elem = par.getWord(delim).trim();
     if (elem != null && elem.length() > 0) elements.addElement(elem);
     par.skipChar();
   }
   return elements;
 }
Esempio n. 2
0
 /** Removes specified parameter (if present) */
 public void removeParameter(String name) {
   int index = url.indexOf(';');
   if (index < 0) return;
   Parser par = new Parser(url, index);
   while (par.hasMore()) {
     int begin_param = par.getPos();
     par.skipChar();
     if (par.getWord(SipParser.param_separators).equals(name)) {
       String top = url.substring(0, begin_param);
       par.goToSkippingQuoted(';');
       String bottom = "";
       if (par.hasMore()) bottom = url.substring(par.getPos());
       url = top.concat(bottom);
       return;
     }
     par.goTo(';');
   }
 }