NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.header
Class ParametersHeader

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.javax.sip.header.SIPObject
              |
              +--gov.nist.javax.sip.header.SIPHeader
                    |
                    +--gov.nist.javax.sip.header.ParametersHeader
All Implemented Interfaces:
Cloneable, Header, Parameters, Serializable, SIPHeaderNames
Direct Known Subclasses:
Accept, AcceptEncoding, AcceptLanguage, AddressParametersHeader, AlertInfo, AuthenticationHeader, AuthenticationInfo, CallInfo, ContentDisposition, ContentType, ErrorInfo, Event, Reason, RetryAfter, SubscriptionState, Via

public abstract class ParametersHeader
extends SIPHeader
implements Parameters

Parameters header. Suitable for extension by headers that have parameters.

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gov.nist.javax.sip.header.SIPHeaderNames
ACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALERT_INFO, ALLOW, ALLOW_EVENTS, AUTHENTICATION_INFO, AUTHORIZATION, CALL_ID, CALL_INFO, CONTACT, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, CSEQ, DATE, ERROR_INFO, EVENT, EXPIRES, FROM, IN_REPLY_TO, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Method Summary
 String getParameter(String name)
          Returns the value of the named parameter, or null if it is not set.
 Iterator getParameterNames()
          Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.
 NameValueList getParameters()
          get the parameter list.
 Object getParameterValue(String name)
          Return the parameter as an object (dont convert to string).
 boolean hasParameter(String parameterName)
          Return true if has a parameter.
 boolean hasParameters()
          Return true if you have a parameter and false otherwise.
 void removeParameter(String name)
          Removes the specified parameter from Parameters of this ParametersHeader.
 void removeParameters()
          Remove all parameters.
 void setParameter(NameValue nameValue)
          Set the parameter given a name and value.
 void setParameter(String name, String value)
          Sets the value of the specified parameter.
 void setParameters(NameValueList parameters)
          Set the parameter list.
 void setQuotedParameter(String name, String value)
          Sets the value of the specified parameter.
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
encode, getHeaderName, getHeaderValue, getName, getValue, isHeaderList, setHeaderName
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
clone, dbgPrint, debugDump, debugDump, equals, match, merge, replace, replace, replace, replace, toString
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.Header
clone, equals, toString
 

Method Detail

getParameter

public String getParameter(String name)
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.

Specified by:
getParameter in interface Parameters
Returns:
the value of specified parameter

getParameterValue

public Object getParameterValue(String name)
Return the parameter as an object (dont convert to string).

Parameters:
name - is the name of the parameter to get.
Returns:
the object associated with the name.

getParameterNames

public Iterator getParameterNames()
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.

Specified by:
getParameterNames in interface Parameters
Returns:
an Iterator over all the parameter names

hasParameters

public boolean hasParameters()
Return true if you have a parameter and false otherwise.

Returns:
true if the parameters list is non-empty.

removeParameter

public void removeParameter(String name)
Removes the specified parameter from Parameters of this ParametersHeader. This method returns silently if the parameter is not part of the ParametersHeader.

Specified by:
removeParameter in interface Parameters
Parameters:
name - - a String specifying the parameter name

setParameter

public void setParameter(String name,
                         String value)
                  throws ParseException
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

Specified by:
setParameter in interface Parameters
Parameters:
name - - a String specifying the parameter name
value - - a String specifying the parameter value
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the parameter name or value.

setQuotedParameter

public void setQuotedParameter(String name,
                               String value)
                        throws ParseException
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

Parameters:
name - - a String specifying the parameter name
value - - a String specifying the parameter value
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the parameter name or value.

hasParameter

public boolean hasParameter(String parameterName)
Return true if has a parameter.

Returns:
true if the parameter exists and false if not.

removeParameters

public void removeParameters()
Remove all parameters.


getParameters

public NameValueList getParameters()
get the parameter list.

Returns:
parameter list

setParameter

public void setParameter(NameValue nameValue)
Set the parameter given a name and value.

Parameters:
nameValue - - the name value of the parameter to set.

setParameters

public void setParameters(NameValueList parameters)
Set the parameter list.


NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.