public final class Text extends TextNode
Element
does not directly contain characters: consecutive
characters are grouped into a Text node and it is this Text node which is a
child of Element.
Note that, unless two consecutive Text nodes have different properties, it is illegal to have two consecutive Text nodes in a parent node. Such consecutives Text nodes should be merged to form a single Text node.
Node.PropertyIterator, Node.Type
ALL_PROPERTIES, EMPTY_LIST, FALSE, listenerData, next, NO_PROPERTY_ITERATOR, parent, previous, properties, readOnly, TRUE, UNSET
Constructor and Description |
---|
Text()
Constructs a empty text node.
|
Text(char[] text,
int offset,
int length)
Constructs a text node containing specified characters.
|
Text(String text)
Constructs a text node containing specified characters.
|
Modifier and Type | Method and Description |
---|---|
Node |
copy()
Returns a deep copy of this node.
|
Node.Type |
getType()
Returns the type of this node.
|
appendText, data, deleteText, getText, getTextChar, getTextChars, getTextLength, insertText, isXMLSpace, replaceText, setText
attributes, attributeValue, canInsertBefore, canReplace, compareTo, copyProperties, deepCopy, document, doGetBaseURL, equals, findCommonAncestor, firstChild, following, getBaseURL, getDocument, getDocumentListenerData, getFirstSibling, getInclusion, getLabel, getLastSibling, getNextElement, getNextSibling, getParent, getParentElement, getPosition, getPreviousElement, getPreviousSibling, getProperties, getProperty, getPropertyCount, getPropertyNames, getShortLabel, getSourceURL, getXPath, hasProperty, indexOfDocumentListenerData, isAncestorOf, isDescendantOf, isEditable, isReadOnly, isSiblingOf, lastChild, lookupInclusion, lookupInclusion, lookupProperty, name, namespacePrefixMap, parent, preceding, putProperty, removeProperties, removeProperty, sameInclusion, setDocumentListenerData, toString, type
public Text()
public Text(String text)
text
- contains characters used to initialize this text nodepublic Text(char[] text, int offset, int length)
text
- contains characters used to initialize this text nodeoffset
- index of first character within text used to
initialize this text nodelength
- number of characters in text used to initialize
this text nodepublic Node copy()
Node
Note that node properties are automatically copied too.
See Node.copyProperties(com.xmlmind.xml.doc.Node)
.