Package org.htmlunit.cyberneko
Class HTMLElements.Element
- java.lang.Object
-
- org.htmlunit.cyberneko.HTMLElements.Element
-
- Enclosing class:
- HTMLElements
public static class HTMLElements.Element extends java.lang.Object
Element information.
-
-
Field Summary
Fields Modifier and Type Field Description static int
BLOCK
Block element.short
bounds
The bounding element code.short[]
closes
List of elements this element can close.short
code
The element code.static int
CONTAINER
Container element.static int
EMPTY
Empty element.int
flags
Informational flags.static int
INLINE
Inline element.java.lang.String
lowercaseName
The element name.java.lang.String
name
The element name.HTMLElements.Element[]
parent
Parent elements.(package private) short[]
parentCodes_
Parent elements.static int
SPECIAL
Special element.
-
Constructor Summary
Constructors Constructor Description Element(short code, java.lang.String name, int flags, short[] parents, short[] closes)
Constructs an element object.Element(short code, java.lang.String name, int flags, short[] parents, short bounds, short[] closes)
Constructs an element object.Element(short code, java.lang.String name, int flags, short parent, short[] closes)
Constructs an element object.Element(short code, java.lang.String name, int flags, short parent, short bounds, short[] closes)
Constructs an element object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
closes(short tag)
boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isBlock()
boolean
isContainer()
boolean
isEmpty()
boolean
isInline()
boolean
isParent(HTMLElements.Element element)
Indicates if the provided element is an accepted parent of current elementboolean
isSpecial()
java.lang.String
toString()
-
-
-
Field Detail
-
INLINE
public static final int INLINE
Inline element.- See Also:
- Constant Field Values
-
BLOCK
public static final int BLOCK
Block element.- See Also:
- Constant Field Values
-
EMPTY
public static final int EMPTY
Empty element.- See Also:
- Constant Field Values
-
CONTAINER
public static final int CONTAINER
Container element.- See Also:
- Constant Field Values
-
SPECIAL
public static final int SPECIAL
Special element.- See Also:
- Constant Field Values
-
code
public final short code
The element code.
-
name
public final java.lang.String name
The element name.
-
lowercaseName
public final java.lang.String lowercaseName
The element name.
-
flags
public final int flags
Informational flags.
-
parent
public HTMLElements.Element[] parent
Parent elements.
-
bounds
public final short bounds
The bounding element code.
-
closes
public final short[] closes
List of elements this element can close.
-
parentCodes_
short[] parentCodes_
Parent elements.
-
-
Constructor Detail
-
Element
public Element(short code, java.lang.String name, int flags, short parent, short[] closes)
Constructs an element object.- Parameters:
code
- The element code.name
- The element name.flags
- Informational flagsparent
- Natural closing parent name.closes
- List of elements this element can close.
-
Element
public Element(short code, java.lang.String name, int flags, short parent, short bounds, short[] closes)
Constructs an element object.- Parameters:
code
- The element code.name
- The element name.flags
- Informational flagsparent
- Natural closing parent name.bounds
- boundscloses
- List of elements this element can close.
-
Element
public Element(short code, java.lang.String name, int flags, short[] parents, short[] closes)
Constructs an element object.- Parameters:
code
- The element code.name
- The element name.flags
- Informational flagsparents
- Natural closing parent names.closes
- List of elements this element can close.
-
Element
public Element(short code, java.lang.String name, int flags, short[] parents, short bounds, short[] closes)
Constructs an element object.- Parameters:
code
- The element code.name
- The element name.flags
- Informational flagsparents
- Natural closing parent names.bounds
- boundscloses
- List of elements this element can close.
-
-
Method Detail
-
isInline
public final boolean isInline()
- Returns:
- true if this element is an inline element.
-
isBlock
public final boolean isBlock()
- Returns:
- true if this element is a block element.
-
isEmpty
public final boolean isEmpty()
- Returns:
- true if this element is an empty element.
-
isContainer
public final boolean isContainer()
- Returns:
- true if this element is a container element.
-
isSpecial
public final boolean isSpecial()
- Returns:
- true if this element is special -- if its content should be parsed ignoring markup.
-
closes
public boolean closes(short tag)
- Parameters:
tag
- The element.- Returns:
- true if this element can close the specified Element.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code for this object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
- Returns:
- true if the objects are equal.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a simple representation to make debugging easier
-
isParent
public boolean isParent(HTMLElements.Element element)
Indicates if the provided element is an accepted parent of current element- Parameters:
element
- the element to test for "paternity"- Returns:
true
ifelement
belongs to theparent
-
-