Package org.attoparser.config
Enum ParseConfiguration.ElementBalancing
- java.lang.Object
-
- java.lang.Enum<ParseConfiguration.ElementBalancing>
-
- org.attoparser.config.ParseConfiguration.ElementBalancing
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ParseConfiguration.ElementBalancing>
- Enclosing class:
- ParseConfiguration
public static enum ParseConfiguration.ElementBalancing extends java.lang.Enum<ParseConfiguration.ElementBalancing>
Enumeration representing the possible actions to be taken with regard to element balancing:
NO_BALANCING
: Do not perform element balancing checks at all. Events will be reported as they appear. There is no guarantee that a DOM tree can be built from the fired events though.REQUIRE_BALANCED
: Require that elements are already correctly balanced in markup, throwing an exception if not. Note that when in HTML mode, this does not require the specification of optional tags such as <tbody>. Also note that this will automatically consider theParseConfiguration.setNoUnmatchedCloseElementsRequired(boolean)
flag to be set to true.AUTO_OPEN_CLOSE
: Auto open and close elements, which includes both those elements that, according to the HTML spec (when in HTML mode) have optional start or end tags (see http://www.w3.org/html/wg/drafts/html/master/syntax.html#optional-tags) and those that simply are unclosed at the moment a parent element needs to be closed (so their closing is forced). As an example of optional tags, the HTML5 spec establishes that <html>, <body> and <tbody> are optional, and that an <li> will close any currently open <li> elements. This is not really ill-formed code, but something allowed by the spec. All of these will be reported as auto-* events by the parser.AUTO_CLOSE
: Equivalent toAUTO_OPEN_CLOSE
but not performing any auto-open operations, so that processing of HTML fragments is possible (no <html> or <body> elements are automatically added).
This enumeration is used at the
ParseConfiguration
class.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTO_CLOSE
AUTO_OPEN_CLOSE
NO_BALANCING
REQUIRE_BALANCED
-
Constructor Summary
Constructors Modifier Constructor Description private
ElementBalancing()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ParseConfiguration.ElementBalancing
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ParseConfiguration.ElementBalancing[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NO_BALANCING
public static final ParseConfiguration.ElementBalancing NO_BALANCING
-
REQUIRE_BALANCED
public static final ParseConfiguration.ElementBalancing REQUIRE_BALANCED
-
AUTO_OPEN_CLOSE
public static final ParseConfiguration.ElementBalancing AUTO_OPEN_CLOSE
-
AUTO_CLOSE
public static final ParseConfiguration.ElementBalancing AUTO_CLOSE
-
-
Method Detail
-
values
public static ParseConfiguration.ElementBalancing[] 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.ElementBalancing c : ParseConfiguration.ElementBalancing.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.ElementBalancing 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
-
-