Package org.attoparser.config
Enum ParseConfiguration.UniqueRootElementPresence
- java.lang.Object
-
- java.lang.Enum<ParseConfiguration.UniqueRootElementPresence>
-
- org.attoparser.config.ParseConfiguration.UniqueRootElementPresence
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ParseConfiguration.UniqueRootElementPresence>
- Enclosing class:
- ParseConfiguration
public static enum ParseConfiguration.UniqueRootElementPresence extends java.lang.Enum<ParseConfiguration.UniqueRootElementPresence>
Enumeration used for determining the behaviour the parser should have with respect to the presence and number of root elements in the parsed document.
Root elements are the elements that appear at the root of the document (e.g. <html> in complete HTML documents). This enumeration allows requiring that the root element is unique always, requiring it only if a document prolog (XML Declaration or DOCTYPE) is present, or not validating this at all.
This enumeration is used at the
ParseConfiguration
class.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEPENDS_ON_PROLOG_DOCTYPE
NOT_VALIDATED
REQUIRED_ALWAYS
-
Field Summary
Fields Modifier and Type Field Description private boolean
dependsOnPrologDoctype
private boolean
requiredAlways
-
Constructor Summary
Constructors Modifier Constructor Description private
UniqueRootElementPresence(boolean requiredAlways, boolean dependsOnPrologDoctype)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isDependsOnPrologDoctype()
boolean
isRequiredAlways()
static ParseConfiguration.UniqueRootElementPresence
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ParseConfiguration.UniqueRootElementPresence[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
REQUIRED_ALWAYS
public static final ParseConfiguration.UniqueRootElementPresence REQUIRED_ALWAYS
-
DEPENDS_ON_PROLOG_DOCTYPE
public static final ParseConfiguration.UniqueRootElementPresence DEPENDS_ON_PROLOG_DOCTYPE
-
NOT_VALIDATED
public static final ParseConfiguration.UniqueRootElementPresence NOT_VALIDATED
-
-
Method Detail
-
values
public static ParseConfiguration.UniqueRootElementPresence[] 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 (ParseConfiguration.UniqueRootElementPresence c : ParseConfiguration.UniqueRootElementPresence.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ParseConfiguration.UniqueRootElementPresence 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
-
isRequiredAlways
public boolean isRequiredAlways()
-
isDependsOnPrologDoctype
public boolean isDependsOnPrologDoctype()
-
-