org.w3c.mwi.mobileok.basic
Enum HTTPErrorsType

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

public enum HTTPErrorsType
extends java.lang.Enum<HTTPErrorsType>

Enumerates all the possible HTTPS and HTTP Response errors that may be returned by the Preprocessor while trying to create the internal moki representation of the Web resource under test.

The errors are formally defined in the HTTP Response and HTTPS sections of the W3C mobileOK Basic Tests 1.0 standard.

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

Enum Constant Summary
HTTP_RESPONSE_1
           
HTTP_RESPONSE_10
           
HTTP_RESPONSE_11
           
HTTP_RESPONSE_12
           
HTTP_RESPONSE_4
           
HTTP_RESPONSE_5
           
HTTP_RESPONSE_6
           
HTTP_RESPONSE_7
           
HTTP_RESPONSE_8
           
HTTP_RESPONSE_9
           
HTTPS_1
           
HTTPS_2
           
HTTPS_3
           
 
Field Summary
private static java.util.Map<HTTPErrorsType,java.lang.String> names
          Static mapping table between HTTP errors and their mobileOK name.
private static java.util.Map<HTTPErrorsType,TestOutcome> severity
          Static mapping table between HTTP errors and their severity.
 
Method Summary
(package private) static TestOutcome getSeverity(HTTPErrorsType type)
          Retrieves the mobileOK severity of an HTTP error.
 java.lang.String toString()
          Returns the mobileOK name of an HTTP error.
static HTTPErrorsType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static HTTPErrorsType[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

HTTP_RESPONSE_1

public static final HTTPErrorsType HTTP_RESPONSE_1

HTTP_RESPONSE_4

public static final HTTPErrorsType HTTP_RESPONSE_4

HTTP_RESPONSE_5

public static final HTTPErrorsType HTTP_RESPONSE_5

HTTP_RESPONSE_6

public static final HTTPErrorsType HTTP_RESPONSE_6

HTTP_RESPONSE_7

public static final HTTPErrorsType HTTP_RESPONSE_7

HTTP_RESPONSE_8

public static final HTTPErrorsType HTTP_RESPONSE_8

HTTP_RESPONSE_9

public static final HTTPErrorsType HTTP_RESPONSE_9

HTTP_RESPONSE_10

public static final HTTPErrorsType HTTP_RESPONSE_10

HTTP_RESPONSE_11

public static final HTTPErrorsType HTTP_RESPONSE_11

HTTP_RESPONSE_12

public static final HTTPErrorsType HTTP_RESPONSE_12

HTTPS_1

public static final HTTPErrorsType HTTPS_1

HTTPS_2

public static final HTTPErrorsType HTTPS_2

HTTPS_3

public static final HTTPErrorsType HTTPS_3
Field Detail

severity

private static final java.util.Map<HTTPErrorsType,TestOutcome> severity
Static mapping table between HTTP errors and their severity.


names

private static final java.util.Map<HTTPErrorsType,java.lang.String> names
Static mapping table between HTTP errors and their mobileOK name.

The mapping table is required because the '-' character cannot be used in enumerations.

Method Detail

values

public static HTTPErrorsType[] 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 (HTTPErrorsType c : HTTPErrorsType.values())
    System.out.println(c);

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

valueOf

public static HTTPErrorsType 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

getSeverity

static TestOutcome getSeverity(HTTPErrorsType type)
Retrieves the mobileOK severity of an HTTP error.

Parameters:
type - the HTTP error.
Returns:
the severity of the HTTP error.

toString

public java.lang.String toString()
Returns the mobileOK name of an HTTP error.

Overrides:
toString in class java.lang.Enum<HTTPErrorsType>