NodeLeafAbstractChild, AbstractContentNode, Comment, Element, Textpublic interface Child extends Node
This may be:
ANY_NODE, IS_COMMENT, IS_ELEMENT, IS_EMPTY_ELEMENT, IS_IGNORABLE_TEXT, IS_TEXT| Modifier and Type | Method | Description |
|---|---|---|
Child |
clone(boolean recurse) |
Return a clone of this node.
|
int |
getIndex() |
|
Parent |
getParent() |
|
default <E extends Parent> |
getParent(java.lang.Class<E> parentClass) |
Returns the parent of this child, cast to a target class.
|
Child |
getRootChild() |
Returns the highest ancestor of this child that is a child.
|
void |
remove() |
Detach this child from its parent.
|
void |
setIndex(int to) |
Set the index of this child.
|
void |
setParent(Parent parent) |
Sets or changes the parent of this child.
|
deepEquals, getDocument, getRootElement, getTypeChild clone(boolean recurse)
NodeChild getRootChild()
This may be this child.
Parent getParent()
null.default <E extends Parent> E getParent(java.lang.Class<E> parentClass)
E - The target type.parentClass - The target class.parentClass object.void setParent(Parent parent)
parent - The new parent. May be null.java.lang.IllegalStateException - When parent can not not be set.int getIndex()
void setIndex(int to)
to - The new index of this child.java.lang.IllegalArgumentException - When this child has no parent,to < 0 or to >= getParent().getChildrenCount().void remove()
Equivalent to setParent(null).
Copyright © 2018. All rights reserved.