public abstract class AbstractMicroNodeWithChildren extends AbstractMicroNode implements IMicroNodeWithChildren
| Constructor and Description |
|---|
AbstractMicroNodeWithChildren() |
| Modifier and Type | Method and Description |
|---|---|
ICommonsList<IMicroNode> |
getAllChildren()
Get a list of all direct child nodes.
|
ICommonsList<IMicroNode> |
getAllChildrenRecursive()
Recursively get all children.
|
IMicroNode |
getChildAtIndex(int nIndex)
Get the child node at the specified index
|
int |
getChildCount() |
IMicroNode |
getFirstChild()
Get the first child node or
null if no child is present |
IMicroNode |
getLastChild()
Get the last child node or
null if no child is present |
String |
getTextContent()
Get the concatenated text content of all direct
IMicroText child
nodes of this element. |
<DSTTYPE> DSTTYPE |
getTextContentWithConversion(Class<DSTTYPE> aDstClass)
Get the concatenated text content of all direct
IMicroText child
nodes of this element. |
boolean |
hasChildren() |
boolean |
isEqualContent(IMicroNode o)
As instances of this class may not implement equals/hashCode we need a way
to determine, if 2 nodes are equal by content.
|
protected void |
onAppendChild(AbstractMicroNode aChildNode)
Callback that is invoked once a child is to be appended.
|
protected void |
onInsertAfter(AbstractMicroNode aChildNode,
IMicroNode aPredecessor)
Callback that is invoked once a child is to be inserted after another
child.
|
protected void |
onInsertAtIndex(int nIndex,
AbstractMicroNode aChildNode)
Callback that is invoked once a child is to be inserted at the specified
index.
|
protected void |
onInsertBefore(AbstractMicroNode aChildNode,
IMicroNode aSuccessor)
Callback that is invoked once a child is to be inserted before another
child.
|
protected EChange |
onRemoveAllChildren()
Remove all children from this node.
|
protected EChange |
onRemoveChild(IMicroNode aChildNode)
Callback when a child is removed.
|
protected EChange |
onRemoveChildAtIndex(int nIndex)
Remove the child not at the specified index.
|
String |
toString() |
appendCDATA, appendCDATA, appendCDATAWithConversion, appendChild, appendComment, appendComment, appendCommentWithConversion, appendContainer, appendElement, appendElement, appendEntityReference, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendProcessingInstruction, appendText, appendText, appendTextWithConversion, detachFromParent, getAllEventTargets, getAllEventTargets, getNextSibling, getParent, getParentElementWithName, getParentElementWithName, getPreviousSibling, hasParent, insertAfter, insertAtIndex, insertBefore, isCDATA, isComment, isContainer, isDocument, isDocumentType, isElement, isEntityReference, isProcessingInstruction, isText, onEvent, registerEventTarget, removeAllChildren, removeChild, removeChildAtIndex, replaceChild, unregisterEventTargetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetClone, getTextContentTrimmedappendCDATA, appendCDATA, appendCDATA, appendCDATAWithConversion, appendChild, appendComment, appendComment, appendComment, appendCommentWithConversion, appendContainer, appendElement, appendElement, appendEntityReference, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendProcessingInstruction, appendText, appendText, appendText, appendTextWithConversion, detachFromParent, getAllEventTargets, getAllEventTargets, getNextSibling, getNodeName, getNodeValue, getParent, getParentElementWithName, getParentElementWithName, getPreviousSibling, getType, hasParent, insertAfter, insertAtIndex, insertBefore, isCDATA, isComment, isContainer, isDocument, isDocumentType, isElement, isEntityReference, isProcessingInstruction, isText, registerEventTarget, removeAllChildren, removeChild, removeChildAtIndex, replaceChild, unregisterEventTargethasNoChildrenprotected void onAppendChild(@Nonnull AbstractMicroNode aChildNode)
AbstractMicroNodeonAppendChild in class AbstractMicroNodeaChildNode - The appended child node.protected final void onInsertBefore(@Nonnull AbstractMicroNode aChildNode, @Nonnull IMicroNode aSuccessor)
AbstractMicroNodeonInsertBefore in class AbstractMicroNodeaChildNode - The new child node to be inserted.aSuccessor - The node before which the new node will be inserted.protected final void onInsertAfter(@Nonnull AbstractMicroNode aChildNode, @Nonnull IMicroNode aPredecessor)
AbstractMicroNodeonInsertAfter in class AbstractMicroNodeaChildNode - The new child node to be inserted.aPredecessor - The node after which the new node will be inserted.protected final void onInsertAtIndex(@Nonnegative int nIndex, @Nonnull AbstractMicroNode aChildNode)
AbstractMicroNodeonInsertAtIndex in class AbstractMicroNodenIndex - The index where the node should be inserted.aChildNode - The new child node to be inserted.@Nonnull protected final EChange onRemoveChild(@Nonnull IMicroNode aChildNode)
AbstractMicroNodeonRemoveChild in class AbstractMicroNodeaChildNode - The child that is removed.EChange.CHANGED if something changed@Nonnull protected final EChange onRemoveChildAtIndex(@Nonnegative int nIndex)
AbstractMicroNodeonRemoveChildAtIndex in class AbstractMicroNodenIndex - The 0-based index of the item to be removed.EChange.CHANGED if the node was successfully removed,
EChange.UNCHANGED otherwise.@Nonnull protected final EChange onRemoveAllChildren()
AbstractMicroNodeonRemoveAllChildren in class AbstractMicroNodeEChange.CHANGED if at least one child was present, and was
successfully removed, EChange.UNCHANGED otherwise.public final boolean hasChildren()
hasChildren in interface IHasChildren<IMicroNode>hasChildren in interface IMicroNodehasChildren in class AbstractMicroNodetrue if at least one child is present,
false otherwise@Nullable @ReturnsMutableCopy public final ICommonsList<IMicroNode> getAllChildren()
IMicroNodegetAllChildren in interface IHasChildren<IMicroNode>getAllChildren in interface IHasChildrenSorted<IMicroNode>getAllChildren in interface IMicroNodegetAllChildren in class AbstractMicroNodenull if the node has no children.@Nullable public final IMicroNode getChildAtIndex(@Nonnegative int nIndex)
IHasChildrenSortedgetChildAtIndex in interface IHasChildrenSorted<IMicroNode>getChildAtIndex in class AbstractMicroNodenIndex - The index to be queried. May not be < 0 or ≥ the number of
childrennull if the index
is invalid.public final int getChildCount()
getChildCount in interface IHasChildren<IMicroNode>getChildCount in class AbstractMicroNode@Nullable public final IMicroNode getFirstChild()
IHasChildrenSortednull if no child is presentgetFirstChild in interface IHasChildrenSorted<IMicroNode>getFirstChild in interface IMicroNodegetFirstChild in class AbstractMicroNodenull if this
node has no children.@Nullable public final IMicroNode getLastChild()
IHasChildrenSortednull if no child is presentgetLastChild in interface IHasChildrenSorted<IMicroNode>getLastChild in interface IMicroNodegetLastChild in class AbstractMicroNodenull if this node
has no children.@Nonnull @ReturnsMutableCopy public final ICommonsList<IMicroNode> getAllChildrenRecursive()
IMicroNodegetAllChildrenRecursive in interface IMicroNodegetAllChildrenRecursive in class AbstractMicroNodenull if this node has no children.@Nullable public String getTextContent()
IMicroNodeWithChildrenIMicroText child
nodes of this element.getTextContent in interface IMicroNodeWithChildrennull if the element contains no text node as child@Nullable public <DSTTYPE> DSTTYPE getTextContentWithConversion(@Nonnull Class<DSTTYPE> aDstClass)
IMicroNodeWithChildrenIMicroText child
nodes of this element. The value is converted via the
TypeConverter to the desired
destination class.getTextContentWithConversion in interface IMicroNodeWithChildrenDSTTYPE - The destination type to convert the String textContent to.aDstClass - The destination class to which the text content should be converted.null if the element contains no text node as child@OverridingMethodsMustInvokeSuper public boolean isEqualContent(@Nullable IMicroNode o)
IMicroNodeisEqualContent in interface IMicroNodeo - The node to compare to this.true if the nodes are of the same type and the same
content, false otherwise.public String toString()
toString in class AbstractMicroNodeCopyright © 2014–2016 Philip Helger. All rights reserved.