Package nu.validator.htmlparser.common
Enum DoctypeExpectation
- java.lang.Object
-
- java.lang.Enum<DoctypeExpectation>
-
- nu.validator.htmlparser.common.DoctypeExpectation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DoctypeExpectation>
public enum DoctypeExpectation extends java.lang.Enum<DoctypeExpectation>
Used for indicating desired behavior with legacy doctypes.- Version:
- $Id$
- Author:
- hsivonen
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTO
Treat the doctype required by HTML 5, doctypes with the HTML 4.01 Strict public id and doctypes with the HTML 4.01 Transitional public id and a system id as non-errors.HTML
Be a pure HTML5 parser.HTML401_STRICT
Require the HTML 4.01 Transitional public id and a system id.HTML401_TRANSITIONAL
Require the HTML 4.01 Transitional public id.NO_DOCTYPE_ERRORS
Never enable HTML4-specific error checks.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoctypeExpectation
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DoctypeExpectation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HTML
public static final DoctypeExpectation HTML
Be a pure HTML5 parser.
-
HTML401_TRANSITIONAL
public static final DoctypeExpectation HTML401_TRANSITIONAL
Require the HTML 4.01 Transitional public id. Turn on HTML4-specific additional errors regardless of doctype.
-
HTML401_STRICT
public static final DoctypeExpectation HTML401_STRICT
Require the HTML 4.01 Transitional public id and a system id. Turn on HTML4-specific additional errors regardless of doctype.
-
AUTO
public static final DoctypeExpectation AUTO
Treat the doctype required by HTML 5, doctypes with the HTML 4.01 Strict public id and doctypes with the HTML 4.01 Transitional public id and a system id as non-errors. Turn on HTML4-specific additional errors if the public id is the HTML 4.01 Strict or Transitional public id.
-
NO_DOCTYPE_ERRORS
public static final DoctypeExpectation NO_DOCTYPE_ERRORS
Never enable HTML4-specific error checks. Never report any doctype condition as an error. (Doctype tokens in wrong places will be reported as errors, though.) The application may decide what to log in response to calls toDocumentModeHanler
. This mode in meant for doing surveys on existing content.
-
-
Method Detail
-
values
public static DoctypeExpectation[] 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 (DoctypeExpectation c : DoctypeExpectation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DoctypeExpectation 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 namejava.lang.NullPointerException
- if the argument is null
-
-