org.w3c.mwi.mobileok.basic
Enum HeaderParseMethod

java.lang.Object
  extended by java.lang.Enum<HeaderParseMethod>
      extended by org.w3c.mwi.mobileok.basic.HeaderParseMethod
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<HeaderParseMethod>

 enum HeaderParseMethod
extends java.lang.Enum<HeaderParseMethod>

Enumerates the possible HTTP header fields values parsing rules and maps well-known HTTP header fields to parsing rules.

The values are not all used by the mobileOK Checker at this point. Only PARSE_AND_NORMALIZE and PARSE_BUT_DO_NOT_NORMALIZE really trigger a specific behavior.

Version:
$Revision: 1.1 $
Author:
The W3C mobileOK Checker Task Force

Enum Constant Summary
PARSE_AND_NORMALIZE
           
PARSE_AS_AUTHENTICATION
           
PARSE_AS_AUTHORIZATION
           
PARSE_AS_DATE
           
PARSE_AS_ETAG
           
PARSE_AS_PRODUCT_LIST
           
PARSE_AS_URI
           
PARSE_BUT_DO_NOT_NORMALIZE
           
PARSE_DO_NOT
           
 
Field Summary
private static java.util.Map<java.lang.String,HeaderParseMethod> HEADER_MAP
          Mapping table between well-known HTTP Header fields and parsing methods.
 
Method Summary
(package private) static HeaderParseMethod forHeader(java.lang.String header)
          Retrieves the parsing method to use to parse a given HTTP Header field.
static HeaderParseMethod valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static HeaderParseMethod[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PARSE_DO_NOT

public static final HeaderParseMethod PARSE_DO_NOT

PARSE_BUT_DO_NOT_NORMALIZE

public static final HeaderParseMethod PARSE_BUT_DO_NOT_NORMALIZE

PARSE_AND_NORMALIZE

public static final HeaderParseMethod PARSE_AND_NORMALIZE

PARSE_AS_AUTHENTICATION

public static final HeaderParseMethod PARSE_AS_AUTHENTICATION

PARSE_AS_AUTHORIZATION

public static final HeaderParseMethod PARSE_AS_AUTHORIZATION

PARSE_AS_URI

public static final HeaderParseMethod PARSE_AS_URI

PARSE_AS_ETAG

public static final HeaderParseMethod PARSE_AS_ETAG

PARSE_AS_DATE

public static final HeaderParseMethod PARSE_AS_DATE

PARSE_AS_PRODUCT_LIST

public static final HeaderParseMethod PARSE_AS_PRODUCT_LIST
Field Detail

HEADER_MAP

private static final java.util.Map<java.lang.String,HeaderParseMethod> HEADER_MAP
Mapping table between well-known HTTP Header fields and parsing methods.

Method Detail

values

public static HeaderParseMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HeaderParseMethod c : HeaderParseMethod.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HeaderParseMethod valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

forHeader

static HeaderParseMethod forHeader(java.lang.String header)
Retrieves the parsing method to use to parse a given HTTP Header field.

Parameters:
header - HTTP header field name to parse
Returns:
the parsing method to use, PARSE_DO_NOT if the header is unknown.