ANY_NODE, IS_COMMENT, IS_ELEMENT, IS_EMPTY_ELEMENT, IS_IGNORABLE_TEXT, IS_TEXT| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addChild(Child child) |
Add a child to this parent, if possible.
|
boolean |
canAddChild(Child child) |
Returns true when a child can be added.
|
void |
clearChildren() |
Removes all children.
|
Parent |
clone(boolean recurse) |
Return a clone of this node.
|
void |
ensureChildren() |
|
default Child |
getChildAt(int index) |
Return the child at a given, index or null.
|
java.util.List<AbstractChild> |
getChildren() |
|
default <T extends Node> |
getChildren(java.lang.Class<T> childClass) |
Returns an Iterable of children that are instance of a given class.
|
default <T extends Node> |
getChildren(java.lang.Class<T> childClass,
java.util.function.Predicate<? super T> predicate) |
Returns an Iterable of children that are instance of a given class and match a predicate.
|
default int |
getChildrenCount() |
|
default int |
getChildrenCount(java.lang.Class<? extends Node> childClass) |
|
default Child |
getLastChild() |
|
default boolean |
hasChildren(java.lang.Class<? extends Node> childClass) |
|
boolean |
removeChild(Child child) |
Remove a child.
|
Child |
removeChildAt(int index) |
Remove the child located at a given index.
|
boolean |
supportsChildType(NodeType type) |
Returns true when this node supports a child of a given type.
|
deepEquals, getDocument, getRootElement, getTypeParent clone(boolean recurse)
Nodeboolean supportsChildType(NodeType type)
type - The type.boolean canAddChild(Child child)
child - The childvoid ensureChildren()
java.util.List<AbstractChild> getChildren()
default <T extends Node> java.lang.Iterable<T> getChildren(java.lang.Class<T> childClass)
T - Type of searched children.childClass - The class of searched children.childClass.default <T extends Node> java.lang.Iterable<T> getChildren(java.lang.Class<T> childClass, java.util.function.Predicate<? super T> predicate)
T - Type of searched children.childClass - The class of searched children.predicate - The predicate.childClass and match predicate.default int getChildrenCount()
default int getChildrenCount(java.lang.Class<? extends Node> childClass)
default boolean hasChildren(java.lang.Class<? extends Node> childClass)
default Child getChildAt(int index)
Null is returned when index is invalid.
index - The index.default Child getLastChild()
boolean addChild(Child child)
If possible, child current parent is changed to this node.
child - The child.boolean removeChild(Child child)
If child is not a child of this parent, then false is returned.
child - The child.Child removeChildAt(int index)
If index is invalid, returns false.
index - The index.void clearChildren()
Copyright © 2018. All rights reserved.