public interface Element
Modifier and Type | Field and Description |
---|---|
static Element[] |
EMPTY_ELEMENT_ARRAY
Empty element array.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttribute(java.lang.String attribute)
Gets the value of an attribute.
|
Element |
getChild(int index)
Gets the child element at an index.
|
int |
getChildrenCount()
Gets the number of children of this element.
|
Element[] |
getChildrenElements()
Gets the children elements.
|
Element |
getParentElement()
Gets the parent element.
|
boolean |
hasClassSelector(java.lang.String classSelector)
Gets whether or not the element has the given class selector.
|
boolean |
isInState(State state)
Gets whether or not the element is in the given state.
|
@NonNull static final Element[] EMPTY_ELEMENT_ARRAY
getChildrenElements()
boolean hasClassSelector(@NonNull java.lang.String classSelector)
classSelector
- the class selector to check.true
if the element has the given class selector, false
otherwise.boolean isInState(@NonNull State state)
state
- the state to check.true
if the element is in the given state, false
otherwise.@Nullable java.lang.String getAttribute(@NonNull java.lang.String attribute)
attribute
- the attribute to search.null
if the attribute does not exist.@Nullable Element getParentElement()
@NonNull Element[] getChildrenElements()
Returns an empty array if no children.
EMPTY_ELEMENT_ARRAY
@NonNull Element getChild(int index)
index
- the index of the element to get.java.lang.IndexOutOfBoundsException
- if the index is out of range ((index < 0 || index >= getChildrenCount()
)int getChildrenCount()