public interface IMicroNode extends ICloneable<IMicroNode>, IHasChildrenSorted<IMicroNode>, IHasParent<IMicroNode>, Serializable
| Modifier and Type | Method and Description |
|---|---|
IMicroCDATA |
appendCDATA(char[] aChars)
Append a CDATA node to this node.
|
IMicroCDATA |
appendCDATA(char[] aChars,
int nOfs,
int nLen)
Append a CDATA node to this node.
|
IMicroCDATA |
appendCDATA(CharSequence sText)
Append a CDATA node to this node.
|
IMicroCDATA |
appendCDATAWithConversion(Object aValue)
Append a CDATA node to this node.
|
<NODETYPE extends IMicroNode> |
appendChild(NODETYPE aChildNode)
Append any child to the node.
|
IMicroComment |
appendComment(char[] aChars)
Append a comment node to this node.
|
IMicroComment |
appendComment(char[] aChars,
int nOfs,
int nLen)
Append a comment node to this node.
|
IMicroComment |
appendComment(CharSequence sText)
Append a comment node to this node.
|
IMicroComment |
appendCommentWithConversion(Object aValue)
Append a comment node to this node.
|
IMicroContainer |
appendContainer()
Append a new container to this node
|
IMicroElement |
appendElement(IHasElementName aElementNameProvider)
Append an element without namespace to this node.
|
IMicroElement |
appendElement(String sTagName)
Append an element without namespace to this node.
|
IMicroElement |
appendElement(String sNamespaceURI,
IHasElementName aElementNameProvider)
Append an element with namespace to this node.
|
IMicroElement |
appendElement(String sNamespaceURI,
String sTagName)
Append an element with namespace to this node.
|
IMicroEntityReference |
appendEntityReference(String sName)
Append an entity reference to this node.
|
IMicroText |
appendIgnorableWhitespaceText(char[] aChars)
Append a text node which is ignorable whitespace content to this node.
|
IMicroText |
appendIgnorableWhitespaceText(char[] aChars,
int nOfs,
int nLen)
Append a text node which is ignorable whitespace content to this node.
|
IMicroText |
appendIgnorableWhitespaceText(CharSequence sText)
Append a text node which is ignorable whitespace content to this node.
|
IMicroProcessingInstruction |
appendProcessingInstruction(String sTarget,
String sData)
Append a processing instruction to this node.
|
IMicroText |
appendText(char[] aChars)
Append a text node to this node.
|
IMicroText |
appendText(char[] aChars,
int nOfs,
int nLen)
Append a text node to this node.
|
IMicroText |
appendText(CharSequence sText)
Append a text node to this node.
|
IMicroText |
appendTextWithConversion(Object aValue)
Append a text node to this node.
|
IMicroNode |
detachFromParent()
Detach this node from the parent node so it can be inserted into another
node without problems.
|
List<IMicroNode> |
getAllChildrenRecursive()
Recursively get all children.
|
List<IMicroNode> |
getChildren()
Get a list of all direct child nodes.
|
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 |
IMicroNode |
getNextSibling() |
String |
getNodeName() |
String |
getNodeValue() |
IMicroNode |
getParent()
Get the parent object of this object.
|
IMicroElement |
getParentElementWithName(String sTagName) |
IMicroElement |
getParentElementWithName(String sNamespaceURI,
String sTagName) |
IMicroNode |
getPreviousSibling() |
EMicroNodeType |
getType() |
boolean |
hasChildren() |
boolean |
hasParent() |
<NODETYPE extends IMicroNode> |
insertAfter(NODETYPE aChildNode,
IMicroNode aPredecessor)
Insert an existing node after a certain child node of this.
|
<NODETYPE extends IMicroNode> |
insertAtIndex(int nIndex,
NODETYPE aChildNode)
Insert an existing node as a child at the specified index.
|
<NODETYPE extends IMicroNode> |
insertBefore(NODETYPE aChildNode,
IMicroNode aSuccessor)
Insert an existing node before a certain child node of this.
|
boolean |
isCDATA() |
boolean |
isComment() |
boolean |
isContainer() |
boolean |
isDocument() |
boolean |
isDocumentType() |
boolean |
isElement() |
boolean |
isEntityReference() |
boolean |
isEqualContent(IMicroNode aNode)
As instances of this class may not implement equals/hashCode we need a way
to determine, if 2 nodes are equal by content.
|
boolean |
isProcessingInstruction() |
boolean |
isText() |
EChange |
registerEventTarget(EMicroEvent eEventType,
IMicroEventTarget aTarget)
Register a specific MicroDOM event listener.
|
EChange |
removeAllChildren()
Remove all children from this node.
|
EChange |
removeChild(IMicroNode aChild)
Remove the passed child.
|
EChange |
removeChildAtIndex(int nIndex)
Remove the child not at the specified index.
|
EChange |
replaceChild(IMicroNode aOldChild,
IMicroNode aNewChild)
Replace the passed old child with the new child.
|
EChange |
unregisterEventTarget(EMicroEvent eEventType,
IMicroEventTarget aTarget)
Unregister a specific MicroDOM event listener.
|
getClonegetChildAtIndexgetChildCount@Nonnull @Nonempty String getNodeName()
String getNodeValue()
IMicroText,
IMicroComment and IMicroEntityReference.boolean hasChildren()
hasChildren in interface IHasChildren<IMicroNode>true if at least one child is present,
false otherwise@Nullable List<IMicroNode> getChildren()
getChildren in interface IHasChildren<IMicroNode>getChildren in interface IHasChildrenSorted<IMicroNode>null if the node has no children.@Nullable IMicroNode getFirstChild()
IHasChildrenSortednull if no child is presentgetFirstChild in interface IHasChildrenSorted<IMicroNode>null if this
node has no children.@Nullable IMicroNode getLastChild()
IHasChildrenSortednull if no child is presentgetLastChild in interface IHasChildrenSorted<IMicroNode>null if this node
has no children.@Nullable List<IMicroNode> getAllChildrenRecursive()
null if this node has no children.@Nullable IMicroNode getPreviousSibling()
null if this node has no preceding siblings.@Nullable IMicroNode getNextSibling()
null
if this node has no succeeding siblings.boolean hasParent()
true if this node has a parent node assigned,
false otherwise.@Nullable IMicroNode getParent()
IHasParentgetParent in interface IHasParent<IMicroNode>null.@Nonnull IMicroNode detachFromParent()
IllegalStateException if adding this node again to another parent
since each node can only have one parent.@Nullable IMicroElement getParentElementWithName(@Nullable String sTagName)
@Nullable IMicroElement getParentElementWithName(@Nullable String sNamespaceURI, @Nullable String sTagName)
@Nullable <NODETYPE extends IMicroNode> NODETYPE appendChild(@Nullable NODETYPE aChildNode) throws MicroException
NODETYPE - Parameter type == return typeaChildNode - The child node to append. May be null.null if the parameter was
null.MicroException - if this node cannot have children@Nullable <NODETYPE extends IMicroNode> NODETYPE insertBefore(@Nullable NODETYPE aChildNode, @Nonnull IMicroNode aSuccessor) throws MicroException
aChildNode - The new child node to be inserted.aSuccessor - The node before which the new node will be inserted.MicroException - if this node cannot have children@Nullable <NODETYPE extends IMicroNode> NODETYPE insertAfter(@Nullable NODETYPE aChildNode, @Nonnull IMicroNode aPredecessor) throws MicroException
aChildNode - The new child node to be inserted.aPredecessor - The node after which the new node will be inserted.MicroException - if this node cannot have children@Nullable <NODETYPE extends IMicroNode> NODETYPE insertAtIndex(@Nonnegative int nIndex, @Nullable NODETYPE aChildNode) throws MicroException
nIndex - The index to insert. Must be ≥ 0.aChildNode - The new child node to be inserted.MicroException - if this node cannot have children@Nonnull IMicroText appendText(@Nullable CharSequence sText) throws MicroException
sText - text to be addedMicroException - if this node cannot have children@Nonnull IMicroText appendText(@Nonnull char[] aChars) throws MicroException
aChars - Characters to append. May not be nullMicroException - if this node cannot have children@Nonnull IMicroText appendText(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen) throws MicroException
aChars - Characters to append. May not be nullnOfs - Offset into the array where to start copying data. May not be <,
0.nLen - Number of bytes to take from the array. May not be <, 0.MicroException - if this node cannot have children@Nonnull IMicroText appendTextWithConversion(@Nullable Object aValue) throws MicroException
String, the TypeConverter is
invoked to convert it to a String object.aValue - text to be addedMicroException - if this node cannot have children@Nonnull IMicroText appendIgnorableWhitespaceText(@Nullable CharSequence sText) throws MicroException
sText - The whitespace content to be added.MicroException - if this node cannot have children@Nonnull IMicroText appendIgnorableWhitespaceText(@Nonnull char[] aChars) throws MicroException
aChars - Characters to append. May not be nullMicroException - if this node cannot have children@Nonnull IMicroText appendIgnorableWhitespaceText(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen) throws MicroException
aChars - Characters to append. May not be nullnOfs - Offset into the array where to start copying data. May not be <,
0.nLen - Number of bytes to take from the array. May not be <, 0.MicroException - if this node cannot have children@Nonnull IMicroCDATA appendCDATA(@Nullable CharSequence sText) throws MicroException
sText - CDATA textMicroException - if this node cannot have children@Nonnull IMicroCDATA appendCDATA(@Nonnull char[] aChars) throws MicroException
aChars - Characters to append. May not be nullMicroException - if this node cannot have children@Nonnull IMicroCDATA appendCDATA(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen) throws MicroException
aChars - Characters to append. May not be nullnOfs - Offset into the array where to start copying data. May not be <,
0.nLen - Number of bytes to take from the array. May not be <, 0.MicroException - if this node cannot have children@Nonnull IMicroCDATA appendCDATAWithConversion(@Nullable Object aValue) throws MicroException
String, the TypeConverter is
invoked to convert it to a String object.aValue - CDATA to be addedMicroException - if this node cannot have children@Nonnull IMicroComment appendComment(@Nullable CharSequence sText) throws MicroException
sText - comment textMicroException - if this node cannot have children@Nonnull IMicroComment appendComment(@Nonnull char[] aChars) throws MicroException
aChars - Characters to append. May not be nullMicroException - if this node cannot have children@Nonnull IMicroComment appendComment(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen) throws MicroException
aChars - Characters to append. May not be nullnOfs - Offset into the array where to start copying data. May not be <,
0.nLen - Number of bytes to take from the array. May not be <, 0.MicroException - if this node cannot have children@Nonnull IMicroComment appendCommentWithConversion(@Nullable Object aValue) throws MicroException
String, the TypeConverter is
invoked to convert it to a String object.aValue - Comment to be addedMicroException - if this node cannot have children@Nonnull IMicroEntityReference appendEntityReference(@Nonnull String sName) throws MicroException
sName - The name of the entity reference.MicroException - if this node cannot have children@Nonnull IMicroElement appendElement(@Nonnull@Nonempty String sTagName) throws MicroException
sTagName - Element name to be created. May neither be null nor
empty.MicroException - if this node cannot have children@Nonnull IMicroElement appendElement(@Nullable String sNamespaceURI, @Nonnull@Nonempty String sTagName) throws MicroException
sNamespaceURI - Namespace URI to use. May be null.sTagName - Element name to be created. May neither be null nor
empty.MicroException - if this node cannot have children@Nonnull IMicroElement appendElement(@Nonnull IHasElementName aElementNameProvider) throws MicroException
aElementNameProvider - Element name provider. May not be null.MicroException - if this node cannot have children@Nonnull IMicroElement appendElement(@Nullable String sNamespaceURI, @Nonnull IHasElementName aElementNameProvider) throws MicroException
sNamespaceURI - Namespace URI to use. May be null.aElementNameProvider - Element name provider. May not be null.MicroException - if this node cannot have children@Nonnull IMicroProcessingInstruction appendProcessingInstruction(@Nonnull@Nonempty String sTarget, @Nullable String sData) throws MicroException
sTarget - The PI targetsData - The PI dataMicroException - if this node cannot have children@Nonnull IMicroContainer appendContainer() throws MicroException
MicroException - if this node cannot have children@Nonnull EChange removeChild(@Nonnull IMicroNode aChild)
aChild - The child to be removed. May not be null.EChange.CHANGED if the child was successfully removed,
EChange.UNCHANGED otherwise.@Nonnull EChange removeChildAtIndex(@Nonnegative int nIndex)
nIndex - The 0-based index of the item to be removed.EChange.CHANGED if the node was successfully removed,
EChange.UNCHANGED otherwise.@Nonnull EChange removeAllChildren()
EChange.CHANGED if at least one child was present, and was
successfully removed, EChange.UNCHANGED otherwise.@Nonnull EChange replaceChild(@Nonnull IMicroNode aOldChild, @Nonnull IMicroNode aNewChild)
aOldChild - The child to be removed. May not be null.aNewChild - The child to be inserted instead. May not be null.EChange.CHANGED if the child was successfully replaced,
EChange.UNCHANGED if old child and new child are identical.@Nonnull EMicroNodeType getType()
null.boolean isDocument()
true if this node can safely be casted to
IMicroDocument.boolean isDocumentType()
true if this node can safely be casted to
IMicroDocumentType.boolean isText()
true if this node can safely be casted to
IMicroText.boolean isCDATA()
true if this node can safely be casted to
IMicroCDATA.boolean isComment()
true if this node can safely be casted to
IMicroComment.boolean isEntityReference()
true if this node can safely be casted to
IMicroEntityReference.boolean isElement()
true if this node can safely be casted to
IMicroElement.boolean isProcessingInstruction()
true if this node can safely be casted to
IMicroProcessingInstruction.boolean isContainer()
true if this node can safely be casted to
IMicroContainer.@Nonnull EChange registerEventTarget(@Nonnull EMicroEvent eEventType, @Nonnull IMicroEventTarget aTarget)
eEventType - The event type. May not be null.aTarget - The event target to be added. May not be null.EChange.CHANGED if the event listener was registered,
EChange.UNCHANGED otherwise.@Nonnull EChange unregisterEventTarget(@Nonnull EMicroEvent eEventType, @Nonnull IMicroEventTarget aTarget)
eEventType - The event type. May not be null.aTarget - The event target to be added. May not be null.EChange.CHANGED if the event listener was unregistered,
EChange.UNCHANGED otherwise.boolean isEqualContent(@Nullable IMicroNode aNode)
aNode - The node to compare to this.true if the nodes are of the same type and the same
content, false otherwise.Copyright © 2006–2015 phloc systems. All rights reserved.