org.w3c.www.http
Class HttpAccept

java.lang.Object
  extended by org.w3c.www.http.BasicValue
      extended by org.w3c.www.http.HttpAccept
All Implemented Interfaces:
java.lang.Cloneable, HeaderValue

public class HttpAccept
extends BasicValue


Field Summary
protected  java.lang.String[] aparams
          The list of accept parameters name.
protected  java.lang.String[] avalues
          The list of accept parameters value.
protected  double quality
          the quality
protected  MimeType type
          The accepted MIME type.
 
Fields inherited from class org.w3c.www.http.BasicValue
isValid, raw, rlen, roff
 
Constructor Summary
HttpAccept()
           
 
Method Summary
 java.lang.String getAcceptParameter(java.lang.String name)
          Get the String value for a parameter.
 MimeType getMimeType()
          Get this object accepted MIME type.
 double getQuality()
          Get the quality of this accept clause.
 java.lang.Object getValue()
          HeaderValue implemenntation - Get this header value.
protected  void invalideByteValue()
           
protected  int lookup(java.lang.String name)
          Lookup for the given parameter binding.
protected  void parse()
          parse.
 void setAcceptParameter(java.lang.String name, java.lang.String value)
          Set the value of an accept parameter.
 void setMimeType(MimeType type)
          Set the accepted MIME type.
protected  void updateByteValue()
          Update the RFC822 compatible header value for this object.
 
Methods inherited from class org.w3c.www.http.BasicValue
addBytes, appendValue, checkByteValue, clone, emit, error, invalidateByteValue, setBytes, setString, toExternalForm, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aparams

protected java.lang.String[] aparams
The list of accept parameters name.


avalues

protected java.lang.String[] avalues
The list of accept parameters value.


type

protected MimeType type
The accepted MIME type.


quality

protected double quality
the quality

Constructor Detail

HttpAccept

public HttpAccept()
Method Detail

parse

protected void parse()
              throws HttpParserException
parse.

Specified by:
parse in class BasicValue
Throws:
HttpParserException - if parsing failed.

updateByteValue

protected void updateByteValue()
Description copied from class: BasicValue
Update the RFC822 compatible header value for this object.

Specified by:
updateByteValue in class BasicValue

invalideByteValue

protected void invalideByteValue()

getValue

public java.lang.Object getValue()
Description copied from class: BasicValue
HeaderValue implemenntation - Get this header value.

Specified by:
getValue in interface HeaderValue
Specified by:
getValue in class BasicValue
Returns:
An object representing the parsed value for this header.

lookup

protected int lookup(java.lang.String name)
Lookup for the given parameter binding.

Returns:
The slot number for this parameter, or -1 if undefined.

getAcceptParameter

public java.lang.String getAcceptParameter(java.lang.String name)
Get the String value for a parameter.

Returns:
The String value for the accept parameter, or null if undefined.

setAcceptParameter

public void setAcceptParameter(java.lang.String name,
                               java.lang.String value)
Set the value of an accept parameter.

Parameters:
name - The name of the accept parameter to set.
value - The value of the accept parameter to set.

getMimeType

public MimeType getMimeType()
Get this object accepted MIME type.

Returns:
The accepted MIME type.

setMimeType

public void setMimeType(MimeType type)
Set the accepted MIME type.

Parameters:
type - The accepted MIME type.

getQuality

public double getQuality()
Get the quality of this accept clause.

Returns:
A double value, encoding the quality, or 1.0 if undefined.