public abstract class AbstractMicroNodeWithChildren extends AbstractMicroNode implements IMicroNodeWithChildren
| Constructor and Description |
|---|
AbstractMicroNodeWithChildren() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAnyChild(Predicate<? super IMicroNode> aFilter)
Check if any direct child matching the provided filter is contained.
|
IMicroNode |
findFirstChild(Predicate<? super IMicroNode> aFilter) |
<DSTTYPE> DSTTYPE |
findFirstChildMapped(Predicate<? super IMicroNode> aFilter,
Function<? super IMicroNode,? extends DSTTYPE> aMapper) |
void |
forAllChildren(Consumer<? super IMicroNode> aConsumer) |
void |
forAllChildren(Predicate<? super IMicroNode> aFilter,
Consumer<? super IMicroNode> aConsumer) |
com.helger.commons.state.EContinue |
forAllChildrenBreakable(com.helger.commons.function.IBreakableConsumer<? super IMicroNode> aConsumer) |
<DSTTYPE> void |
forAllChildrenMapped(Predicate<? super IMicroNode> aFilter,
Function<? super IMicroNode,? extends DSTTYPE> aMapper,
Consumer<? super DSTTYPE> aConsumer) |
com.helger.commons.collection.ext.ICommonsList<IMicroNode> |
getAllChildren()
Get a list of all direct child nodes.
|
IMicroNode |
getChildAtIndex(int nIndex) |
int |
getChildCount() |
IMicroNode |
getFirstChild() |
IMicroNode |
getLastChild() |
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 com.helger.commons.state.EChange |
onRemoveAllChildren()
Remove all children from this node.
|
protected com.helger.commons.state.EChange |
onRemoveChild(IMicroNode aChildNode)
Callback when a child is removed.
|
protected com.helger.commons.state.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, getAllChildrenRecursive, 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, unregisterEventTargetprotected 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 com.helger.commons.state.EChange onRemoveChild(@Nonnull IMicroNode aChildNode)
AbstractMicroNodeonRemoveChild in class AbstractMicroNodeaChildNode - The child that is removed.EChange.CHANGED if something changed@Nonnull protected final com.helger.commons.state.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 com.helger.commons.state.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 com.helger.commons.hierarchy.IHasChildren<IMicroNode>hasChildren in class AbstractMicroNode@Nullable @ReturnsMutableCopy public final com.helger.commons.collection.ext.ICommonsList<IMicroNode> getAllChildren()
IMicroNodegetAllChildren in interface com.helger.commons.hierarchy.IHasChildren<IMicroNode>getAllChildren in interface com.helger.commons.hierarchy.IHasChildrenSorted<IMicroNode>getAllChildren in interface IMicroNodegetAllChildren in class AbstractMicroNodenull if the node has no children.public final void forAllChildren(@Nonnull Consumer<? super IMicroNode> aConsumer)
forAllChildren in interface com.helger.commons.hierarchy.IHasChildren<IMicroNode>forAllChildren in class AbstractMicroNode@Nonnull public com.helger.commons.state.EContinue forAllChildrenBreakable(@Nonnull com.helger.commons.function.IBreakableConsumer<? super IMicroNode> aConsumer)
forAllChildrenBreakable in interface com.helger.commons.hierarchy.IHasChildren<IMicroNode>forAllChildrenBreakable in class AbstractMicroNodepublic final void forAllChildren(@Nonnull Predicate<? super IMicroNode> aFilter, @Nonnull Consumer<? super IMicroNode> aConsumer)
forAllChildren in interface com.helger.commons.hierarchy.IHasChildren<IMicroNode>forAllChildren in class AbstractMicroNodepublic final <DSTTYPE> void forAllChildrenMapped(@Nonnull Predicate<? super IMicroNode> aFilter, @Nonnull Function<? super IMicroNode,? extends DSTTYPE> aMapper, @Nonnull Consumer<? super DSTTYPE> aConsumer)
forAllChildrenMapped in interface com.helger.commons.hierarchy.IHasChildren<IMicroNode>forAllChildrenMapped in class AbstractMicroNodepublic boolean containsAnyChild(@Nonnull Predicate<? super IMicroNode> aFilter)
IMicroNodecontainsAnyChild in interface IMicroNodeaFilter - The filter that is applied to all child nodes. May not be
null.true if any child matching the provided filter is
contained, false otherwise.@Nullable public final IMicroNode getChildAtIndex(@Nonnegative int nIndex)
getChildAtIndex in interface com.helger.commons.hierarchy.IHasChildrenSorted<IMicroNode>getChildAtIndex in class AbstractMicroNodepublic final int getChildCount()
getChildCount in interface com.helger.commons.hierarchy.IHasChildren<IMicroNode>getChildCount in class AbstractMicroNode@Nullable public final IMicroNode getFirstChild()
getFirstChild in interface com.helger.commons.hierarchy.IHasChildrenSorted<IMicroNode>getFirstChild in interface IMicroNodegetFirstChild in class AbstractMicroNodenull if this
node has no children.@Nullable public final IMicroNode findFirstChild(@Nonnull Predicate<? super IMicroNode> aFilter)
findFirstChild in interface com.helger.commons.hierarchy.IHasChildrenSorted<IMicroNode>findFirstChild in class AbstractMicroNode@Nullable public final <DSTTYPE> DSTTYPE findFirstChildMapped(@Nonnull Predicate<? super IMicroNode> aFilter, @Nonnull Function<? super IMicroNode,? extends DSTTYPE> aMapper)
findFirstChildMapped in interface com.helger.commons.hierarchy.IHasChildrenSorted<IMicroNode>findFirstChildMapped in class AbstractMicroNode@Nullable public final IMicroNode getLastChild()
getLastChild in interface com.helger.commons.hierarchy.IHasChildrenSorted<IMicroNode>getLastChild in interface IMicroNodegetLastChild 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.