public final class MicroText extends AbstractMicroNode implements IMicroText
IMicroText interface.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_ESCAPE
By default the text should be XML escaped when emitting to a file etc.
|
static boolean |
DEFAULT_IGNORABLE_WHITESPACE
By default the text is not ignorable whitespaces
|
| Constructor and Description |
|---|
MicroText(char[] aChars,
int nOfs,
int nLen,
boolean bIgnorableWhitespace) |
MicroText(CharSequence sText) |
MicroText(CharSequence sText,
boolean bIgnorableWhitespace) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendData(char cChar)
Append a character to the string.
|
void |
appendData(char[] aChars,
int nOfs,
int nLen)
Append characters to the string.
|
void |
appendData(CharSequence sData)
Append characters to the string.
|
IMicroText |
getClone() |
CharSequence |
getData() |
String |
getNodeName() |
String |
getNodeValue() |
EMicroNodeType |
getType() |
boolean |
isElementContentWhitespace()
Check whether the text node consists solely of whitespaces.
|
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.
|
boolean |
isEscape() |
void |
prependData(char cChar)
Add a character to the beginning of the current data.
|
void |
prependData(char[] aChars,
int nOfs,
int nLen)
Add characters to the beginning of the current data.
|
void |
prependData(CharSequence sData)
Add characters to the beginning of the current data.
|
void |
setData(CharSequence sData)
Change the character sequence.
|
MicroText |
setEscape(boolean bEscape) |
String |
toString() |
appendChild, detachFromParent, findFirstChild, findFirstChildMapped, findParentElement, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getAllEventTargets, getAllEventTargets, getChildAtIndex, getChildCount, getChildren, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSibling, hasChildren, hasParent, insertAfter, insertAtIndex, insertBefore, internalResetParentNode, internalSetParentNode, internalTriggerEvent, isCDATA, isComment, isContainer, isDocument, isDocumentType, isElement, isEntityReference, isProcessingInstruction, isText, onAppendChild, onEvent, onInsertAfter, onInsertAtIndex, onInsertBefore, onRemoveAllChildren, onRemoveChild, onRemoveChildAtIndex, registerEventTarget, removeAllChildren, removeChild, removeChildAtIndex, unregisterEventTargetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitappendCDATA, appendCDATA, appendCDATA, appendCDATAWithConversion, appendChild, appendComment, appendComment, appendComment, appendCommentWithConversion, appendContainer, appendElement, appendElement, appendEntityReference, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendProcessingInstruction, appendText, appendText, appendText, appendTextWithConversion, containsAnyChild, detachFromParent, findParentElement, getAllChildren, getAllChildrenRecursive, getAllEventTargets, getAllEventTargets, getFirstChild, getLastChild, getNextSibling, getParent, getParentElementWithName, getParentElementWithName, getPreviousSibling, hasParent, insertAfter, insertAtIndex, insertBefore, isCDATA, isComment, isContainer, isDocument, isDocumentType, isElement, isEntityReference, isProcessingInstruction, isText, registerEventTarget, removeAllChildren, removeChild, removeChildAtIndex, replaceChild, unregisterEventTargetfindFirstChild, findFirstChildMapped, getChildAtIndexpublic static final boolean DEFAULT_IGNORABLE_WHITESPACE
public static final boolean DEFAULT_ESCAPE
public MicroText(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen, boolean bIgnorableWhitespace)
public MicroText(@Nullable CharSequence sText)
public MicroText(@Nullable CharSequence sText, boolean bIgnorableWhitespace)
@Nonnull public EMicroNodeType getType()
getType in interface IMicroNodenull.@Nonnull @Nonempty public String getNodeName()
getNodeName in interface IMicroNodeIMicroElement nodes this is the same as the tag name.@Nonnull public String getNodeValue()
getNodeValue in interface IMicroNodeIMicroText,
IMicroComment and IMicroEntityReference.@Nonnull public CharSequence getData()
getData in interface IMicroDataAwarenull
.public void appendData(@Nullable CharSequence sData)
IMicroDataAwareappendData in interface IMicroDataAwaresData - The characters to be appended.public void appendData(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen)
IMicroDataAwareappendData in interface IMicroDataAwareaChars - Base character array. May not be null.nOfs - Offset to start copying. Must be ≥ 0.nLen - Number of chars to take. Must be ≥ 0.public void appendData(char cChar)
IMicroDataAwareappendData in interface IMicroDataAwarecChar - The character to appendpublic void prependData(@Nullable CharSequence sData)
IMicroDataAwareprependData in interface IMicroDataAwaresData - The characters to be added at the front.public void prependData(@Nonnull char[] aChars, @Nonnegative int nOfs, @Nonnegative int nLen)
IMicroDataAwareprependData in interface IMicroDataAwareaChars - Base character array. May not be null.nOfs - Offset to start copying. Must be ≥ 0.nLen - Number of chars to take. Must be ≥ 0.public void prependData(char cChar)
IMicroDataAwareprependData in interface IMicroDataAwarecChar - The character to preprendpublic void setData(@Nullable CharSequence sData)
IMicroDataAwaresetData in interface IMicroDataAwaresData - The new character sequence to be set.public boolean isElementContentWhitespace()
IMicroTextisElementContentWhitespace in interface IMicroTexttrue if the text node consists solely of whitespaces
(blank, tab etc.).public boolean isEscape()
isEscape in interface IMicroTexttrue if the content of this text node should be
masked, and false if not. By default a text node
should always be masked.@Nonnull public IMicroText getClone()
IMicroTextgetClone in interface com.helger.commons.lang.ICloneable<IMicroNode>getClone in interface IMicroTextpublic 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–2017 Philip Helger. All rights reserved.