    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.www.http.BasicValue

    java.lang.Object
       |
       +----org.w3c.www.http.BasicValue

public abstract class BasicValue
extends Object
implements HeaderValue

##

isValid
  Are the parsed values up to date with the lastly set unparsed value ?
raw
  The header value, as a byte array, if available.
rlen
  The length of the byte value in case the above buffer is shared.
roff
  The offset of the value in the above buffer, in case the buffer is shared.

##

addBytes(byte[], int, int)
  HeaderValue implementation - Add these bytes to the header raw value.
appendValue(HttpBuffer)
  Append this header value to the given output buffer.
checkByteValue()
  Compute the new RFC822 compatible representation of this header value.
emit(OutputStream)
  HeaderValue implementation - Emit this header value to the given output stream.
error(String)
  Emit a parsing error.
getValue()
  HeaderValue implemenntation - Get this header value.
invalidateByteValue()
  Invalidate the current byte value for this header, if any.
parse()
  Parse this header value into its various components.
setBytes(byte[], int, int)
  HeaderValue implementation - Reset the header byte value.
setString(String)
  Set this Header Value by parsing the given String.
toExternalForm()
  Return a String encoding this header value in an HTTP compatible way.
toString()
  Print this header value as it would be emited.
updateByteValue()
  Update the RFC822 compatible header value for this object.
validate()
  Validate the parsed value according to the last set raw value.

##

raw

     protected byte raw[]

  The header value, as a byte array, if available.

roff

     protected int roff

  The offset of the value in the above buffer, in case the buffer is shared.

rlen

     protected int rlen

  The length of the byte value in case the above buffer is shared.

isValid

     protected boolean isValid

  Are the parsed values up to date with the lastly set unparsed value ?

##

parse

     protected abstract void parse() throws HttpParserException

  Parse this header value into its various components.

  Throws: HttpParserException
    if unable to parse.

updateByteValue

     protected abstract void updateByteValue()

  Update the RFC822 compatible header value for this object.

checkByteValue

     protected final void checkByteValue()

  Compute the new RFC822 compatible representation of this header value. If our value is up to date, we just return, otherwise, the abstract `updateByteValue` is called to perform the job.

validate

     protected final void validate() throws HttpInvalidValueException

  Validate the parsed value according to the last set raw value. This will trigger the header value parsing, if it is required at this point.

  Throws: HttpInvalidValueException
    If the value couldn't be parsed properly.

invalidateByteValue

     protected void invalidateByteValue()

  Invalidate the current byte value for this header, if any.

error

     protected void error(String msg) throws HttpParserException

  Emit a parsing error.

  Parameters:
    msg - The error message.
  Throws: HttpParserException
    If the parsing failed.

appendValue

     public void appendValue(HttpBuffer buf)

  Append this header value to the given output buffer.

  Returns:
    The header value as a byte array.

toExternalForm

     public String toExternalForm()

  Return a String encoding this header value in an HTTP compatible way.

  Returns:
    A String.

toString

     public String toString()

  Print this header value as it would be emited.

  Returns:
    A String representation of this header value.
  Overrides:
    toString in class Object

emit

     public void emit(OutputStream out) throws IOException

  HeaderValue implementation - Emit this header value to the given output stream.

  Parameters:
    out - The output stream to emit the header value to.
  Throws: IOException
    If some IO error occured.

addBytes

     public void addBytes(byte buf[],
                          int off,
                          int len)

  HeaderValue implementation - Add these bytes to the header raw value.

  Parameters:
    buf - The byte buffer containing some part of the header value.
    off - The offset of the header value in above buffer.
    len - The length of the header value in above buffer.

setBytes

     public void setBytes(byte buf[],
                          int off,
                          int len)

  HeaderValue implementation - Reset the header byte value.

  Parameters:
    buf - The byte buffer containing some part of the header value.
    off - The offset of the header value in above buffer.
    len - The length of the header value in above buffer.

setString

     public void setString(String strval)

  Set this Header Value by parsing the given String.

  Parameters:
    strval - The String value for that object.
  Returns:
    Itself.

getValue

     public abstract Object getValue()

  HeaderValue implemenntation - Get this header value.

  Returns:
    An object representing the parsed value for this header.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index