Package org.zoolu.tools

Examples of org.zoolu.tools.Parser


   /** Returns the index of the first semicolon before the first parameter.
     * @returns the index of the semicolon before the first parameter, or -1 if no parameter is present. */
   protected int indexOfFirstSemi()
   {  //int index=(new Parser(value)).goToSkippingQuoted(';').skipChar().skipWSP().getPos();
      int index=(new Parser(value)).goToSkippingQuoted(';').getPos();
      return (index>=value.length())? -1 : index;
   }
View Full Code Here


   /** Gets the value of specified parameter.
     * @returns the parameter value or null if parameter does not exist or doesn't have a value (i.e. in case of flag parameter). */
   public String getParameter(String name)
   {  int index=indexOfFirstSemi();
      if (index<0) return null;
      return (new SipParser((new Parser(getValue(),index)).skipChar().skipWSP())).getParameter(name);
   }
View Full Code Here

   /** Gets a String Vector of parameter names.
     * @returns a Vector of String */
   public Vector getParameterNames()
   {  int index=indexOfFirstSemi();
      if (index<0) return new Vector();
      return (new SipParser((new Parser(getValue(),index)).skipChar().skipWSP())).getParameters();
   }
View Full Code Here

   /** Whether there is the specified parameter */
   public boolean hasParameter(String name)
   {  int index=indexOfFirstSemi();
      if (index<0) return false;
      return (new SipParser((new Parser(getValue(),index)).skipChar().skipWSP())).hasParameter(name);
   }
View Full Code Here

   /** Removes specified parameter (if present) */
   public void removeParameter(String name)
   {  int index=indexOfFirstSemi();
      if (index<0) return;
      String header=getValue();
      Parser par=new Parser(header,index);
      while (par.hasMore())
      {  int begin_param=par.getPos();
         par.skipChar();
         if (par.getWord(SipParser.param_separators).equals(name))
         {  String top=header.substring(0,begin_param);
            par.goToSkippingQuoted(';');
            String bottom="";
            if (par.hasMore()) bottom=header.substring(par.getPos());
            header=top.concat(bottom);
            setValue(header);
            return;
            //par=new Parser(header,par.getPos());
         }
         par.goTo(';');
      }
   }
View Full Code Here

   super(hd);
   }

   /** Gets the event name. */
   public String getEvent()
   {  return new Parser(value).getWord(delim);
   }
View Full Code Here

   super(sf);
   }
        
   /** Gets the media type. */
   public String getMedia()
   {  return new Parser(value).getString();
  
View Full Code Here

   return new Parser(value).getString();
  

   /** Gets the media port. */
   public int getPort()
   {  String port=(new Parser(value)).skipString().getString();
      int i=port.indexOf('/');
      if (i<0) return Integer.parseInt(port); else return Integer.parseInt(port.substring(0,i));
  
View Full Code Here

      if (i<0) return Integer.parseInt(port); else return Integer.parseInt(port.substring(0,i));
  

   /** Gets the transport protocol. */
   public String getTransport()
   {  return (new Parser(value)).skipString().skipString().getString();
  
View Full Code Here

   return (new Parser(value)).skipString().skipString().getString();
  

   /** Gets the media formats. */
   public String getFormats()
   {  return (new Parser(value)).skipString().skipString().skipString().skipWSP().getRemainingString();
  
View Full Code Here

TOP

Related Classes of org.zoolu.tools.Parser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.