FileDocCategorySizeDatePackage
ExtensionHeader.javaAPI DocphoneME MR2 API (J2ME)3786Wed May 02 18:00:42 BST 2007gov.nist.siplite.header

ExtensionHeader

public class ExtensionHeader extends ParametersHeader
Use this class when there is no parser for parsing the given header.

Fields Summary
public static final String
NAME
Extension header label.
public static Class
clazz
Class handle.
protected String
valueWithoutParam
Header field value, without parameters.
Constructors Summary
public ExtensionHeader()
Default constructor for a generic header.


     
        clazz = new ExtensionHeader().getClass();
    
public ExtensionHeader(String hdrName, String hdrValue, String pureHeaderValue)
Constructor given the name and value.

param
hdrName is the header name.
param
hdrValue is the header value.
param
pureHeaderValue is the header value without parameters.

        super(hdrName);
        headerValue  = hdrValue;
        valueWithoutParam = pureHeaderValue;
    
Methods Summary
public java.lang.StringencodeBody()
Encodes the body as a textstring.

return
encoded string of body contents

        if (parameters != null && !parameters.isEmpty()) {
            if (valueWithoutParam.equals("")) {
                return parameters.encode();
            } else {
                String separator = Header.isAuthorization(headerName) ?
                    Separators.SP : Separators.SEMICOLON;
                return valueWithoutParam + separator +
                    parameters.encode();
            }
        } else {
            return headerValue;
        }
    
public NameValueListgetParameters()
Gets the parameter list for this extension header.

return
name value list for extension header field

        return parameters;
    
public java.lang.ObjectgetValue()
Gets the value of the header without parameters.

return
value of extension header field

        return valueWithoutParam;
    
public voidsetHeaderValue(java.lang.String value)
Sets the header value field. Overloads the function from the base class.

param
value is the value field to set

        headerValue = value;
        valueWithoutParam = value;
    
public voidsetName(java.lang.String name)
Sets the name for a generic header.

param
name the new name to be set

        headerName = name;
    
public voidsetValue(java.lang.String value)
Sets the value without parameters for a generic header.

param
value the new value to be set

        valueWithoutParam = value;