Package org.attoparser.config
Enum Class ParseConfiguration.ElementBalancing
java.lang.Object
java.lang.Enum<ParseConfiguration.ElementBalancing>
org.attoparser.config.ParseConfiguration.ElementBalancing
- All Implemented Interfaces:
Serializable
,Comparable<ParseConfiguration.ElementBalancing>
,Constable
- Enclosing class:
ParseConfiguration
public static enum ParseConfiguration.ElementBalancing
extends 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static ParseConfiguration.ElementBalancing[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_BALANCING
-
REQUIRE_BALANCED
-
AUTO_OPEN_CLOSE
-
AUTO_CLOSE
-
-
Constructor Details
-
ElementBalancing
private ElementBalancing()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-