FileDocCategorySizeDatePackage
SubscriptionStateParser.javaAPI DocphoneME MR2 API (J2ME)2745Wed May 02 18:00:42 BST 2007gov.nist.siplite.parser

SubscriptionStateParser

public class SubscriptionStateParser extends ParametersParser
Parser for Subscription State header.

Fields Summary
Constructors Summary
protected SubscriptionStateParser()
Default constructor.

public SubscriptionStateParser(String value)
Constructor with header value.

param
value full header value respresented as a string

        super(value);
    
protected SubscriptionStateParser(Lexer lexer)
Constructor with initial lexer engine.

param
lexer initial lexer engine

        super(lexer);
    
Methods Summary
public Headerparse()
Invokes parser for Subscription State header field.

return
the parsed Subscription State header
throws
ParseException if a parsing error occurs

        // A parser for this header should be the same as for any
        // generic header, so use the parser from ExtensionParser.
        Header h = new ExtensionParser(lexer.getBuffer()).parse();

        SubscriptionStateHeader retval = null;
        try {
            retval = new SubscriptionStateHeader(h.getValue().toString());
        } catch (IllegalArgumentException iae) {
            throw new ParseException(iae.getMessage(), 0);
        }

        // Copy parameters from the extension header.
        NameValueList parameterList = ((ParametersHeader)h).getParameters();
        if (parameterList != null && parameterList.size() > 0) {
            retval.setParameters(parameterList);
        }

        // System.out.println(">>> parse(): " + retval);

        return retval;