## org.w3c.www.http
Class HttpTokenList

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

Direct Known Subclasses:
  HttpCaseTokenList, HttpUpperTokenList

public class HttpTokenList
extends BasicValue

Parse a comma separated list of tokens.

Field Summary
`protected static int` | `CASE_ASIS` Don't touch cases of tokens.
`protected static int` | `CASE_LOWER` Convert tokens to lower case.
`protected static int` | `CASE_UPPER` Convert case to upper case.
`protected int` | `casemode`
`protected java.lang.String[]` | `tokens`

Fields inherited from class org.w3c.www.http.BasicValue
`isValid, raw, rlen, roff`

Constructor Summary
`protected` | `HttpTokenList()` Create an empty token list for parsing.
`protected` | `HttpTokenList(java.lang.String tokens)` Create a token list from a comma separated list of tokens.
`protected` | `HttpTokenList(java.lang.String[] tokens)` Create a parsed token list, for emitting.

Method Summary
`void` | `addToken(java.lang.String token, boolean always)` Add a token to this token list.
`java.lang.Object` | `getValue()` Get this token list value.
`boolean` | `hasToken(java.lang.String token, boolean caseSensitive)` Does this token list includes that token ?
`protected void` | `parse()` Parse the byte buffer to build the token list.
`void` | `setValue(java.lang.String[] tokens)`
`protected void` | `updateByteValue()`

Methods inherited from class org.w3c.www.http.BasicValue
`addBytes, appendValue, checkByteValue, emit, error, invalidateByteValue, setBytes, setString, toExternalForm, toString, validate`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### CASE_LOWER

    protected static final int CASE_LOWER

  Convert tokens to lower case.

### CASE_ASIS

    protected static final int CASE_ASIS

  Don't touch cases of tokens.

### CASE_UPPER

    protected static final int CASE_UPPER

  Convert case to upper case.

### tokens

    protected java.lang.String[] tokens

### casemode

    protected int casemode

Constructor Detail

### HttpTokenList

    protected HttpTokenList(java.lang.String[] tokens)

  Create a parsed token list, for emitting.

### HttpTokenList

    protected HttpTokenList(java.lang.String tokens)

  Create a token list from a comma separated list of tokens.

### HttpTokenList

    protected HttpTokenList()

  Create an empty token list for parsing.

Method Detail

### parse

    protected void parse()

  Parse the byte buffer to build the token list.
  Overrides:
    parse in class BasicValue

### updateByteValue

    protected void updateByteValue()

  Overrides:
    updateByteValue in class BasicValue

### getValue

    public java.lang.Object getValue()

  Get this token list value.
  Returns:
    A list of tokens, encoded as a String array, or null if undefined.
  Overrides:
    getValue in class BasicValue

### setValue

    public void setValue(java.lang.String[] tokens)

### addToken

    public void addToken(java.lang.String token,
                         boolean always)

  Add a token to this token list.
  Parameters:
    `token` - The token to add.
    `always` - Always add to the list, even if the token us already present in the list.

### hasToken

    public boolean hasToken(java.lang.String token,
                            boolean caseSensitive)

  Does this token list includes that token ?
  Parameters:
    `token` - The token to look for.
  Returns:
    A boolean, true if found, false otherwise.