Home | History | Annotate | Download | only in ims
      1 package gov.nist.javax.sip.parser.ims;
      2 /*
      3 * Conditions Of Use
      4 *
      5 * This software was developed by employees of the National Institute of
      6 * Standards and Technology (NIST), an agency of the Federal Government.
      7 * Pursuant to title 15 Untied States Code Section 105, works of NIST
      8 * employees are not subject to copyright protection in the United States
      9 * and are considered to be in the public domain.  As a result, a formal
     10 * license is not needed to use the software.
     11 *
     12 * This software is provided by NIST as a service and is expressly
     13 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
     14 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
     15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
     16 * AND DATA ACCURACY.  NIST does not warrant or make any representations
     17 * regarding the use of the software or the results thereof, including but
     18 * not limited to the correctness, accuracy, reliability or usefulness of
     19 * the software.
     20 *
     21 * Permission to use this software is contingent upon your acceptance
     22 * of the terms of this agreement
     23 *
     24 * .
     25 *
     26 */
     27 import java.text.ParseException;
     28 import gov.nist.javax.sip.header.SIPHeader;
     29 import gov.nist.javax.sip.header.ims.PProfileKey;
     30 import gov.nist.javax.sip.parser.AddressParametersParser;
     31 import gov.nist.javax.sip.parser.Lexer;
     32 import gov.nist.javax.sip.parser.TokenTypes;
     33 
     34 /**
     35  *
     36  * @author aayush.bhatnagar
     37  * Rancore Technologies Pvt Ltd, Mumbai India.
     38  *
     39  */
     40 public class PProfileKeyParser extends AddressParametersParser implements TokenTypes{
     41 
     42     protected PProfileKeyParser(Lexer lexer) {
     43         super(lexer);
     44 
     45     }
     46 
     47     public PProfileKeyParser(String profilekey){
     48         super(profilekey);
     49     }
     50 
     51     public SIPHeader parse() throws ParseException {
     52         if (debug)
     53             dbg_enter("PProfileKey.parse");
     54         try {
     55 
     56             this.lexer.match(TokenTypes.P_PROFILE_KEY);
     57             this.lexer.SPorHT();
     58             this.lexer.match(':');
     59             this.lexer.SPorHT();
     60 
     61             PProfileKey p = new PProfileKey();
     62             super.parse(p);
     63             return p;
     64 
     65         } finally {
     66             if (debug)
     67                 dbg_leave("PProfileKey.parse");
     68             }
     69 
     70 
     71     }
     72 
     73 }
     74