|
XML for Java Compatibility API 2.0.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.parser.Child | +--com.ibm.xml.parser.TXCharacterData | +--com.ibm.xml.parser.TXText
The TXText class implements the Text interface as defined by the Document Object Model (DOM).
The Text object contains the non-markup content of an Element. If there is no markup inside an Element's content, the text will be contained in a single Text object that is the child of the Element. Any markup will parse into Child Elements that are siblings of the Text Nodes on either side of it, and whose content will be represented as Text Node children of the markup Element.
Text
,
TXCDATASection
, Serialized FormFields inherited from class com.ibm.xml.parser.Child |
ATTDEF,
ATTLIST,
ELEMENT_DECL,
NAME_ATTDEF,
NAME_ATTLIST,
NAME_CDATA,
NAME_COMMENT,
NAME_DOCFRAGMENT,
NAME_DOCUMENT,
NAME_ELEMENT_DECL,
NAME_PSEUDONODE,
NAME_TEXT,
PSEUDONODE |
Constructor Summary | |
TXText(java.lang.String data)
Constructor. |
Method Summary | |
void |
acceptPost(Visitor visitor)
Implements the accept operation of the visitor design pattern when the end of a TXText Node is recognized when traversing the document object tree. |
void |
acceptPre(Visitor visitor)
Implements the accept operation of the visitor design pattern when the start of a TXText Node is recognized when traversing the document object tree. |
java.lang.Object |
clone()
Clone this Text Node using the appropriate factory. |
boolean |
equals(org.w3c.dom.Node arg,
boolean deep)
|
boolean |
getIsIgnorableWhitespace()
Returns, at the Text level, whether space is to be preserved. |
java.lang.String |
getLanguage()
Returns the XML language ID (the value of the xml:lang attribute) in
use for this Text Node. |
java.lang.String |
getNodeName()
|
short |
getNodeType()
Returns that this object is a Text Node. |
java.lang.String |
getText()
Returns all text associated with this Node without considering entities. |
static java.lang.String |
makePrintable(java.lang.String string)
Translate escape sequences in the specified string into printable characters. |
void |
setIsIgnorableWhitespace(boolean isIgnorableWhitespace)
Sets, at the Text level, whether space is to be preserved. |
void |
splice(org.w3c.dom.Element element,
int offset,
int count)
Deprecated. This method will be removed in next release. |
org.w3c.dom.Text |
splitText(int offset)
Split this text node into two text nodes at the specified offset, keeping both in the tree as siblings. |
static java.lang.String |
trim(java.lang.String string)
Trim all leading and trailing whitespace in the specified String. |
static java.lang.String |
trim(java.lang.String string,
boolean trimHead,
boolean trimTail)
Conditionally trim all leading and trailing whitespace in the specified String. |
Methods inherited from class com.ibm.xml.parser.TXCharacterData |
appendData,
deleteData,
getData,
getLength,
getNodeValue,
insertData,
replaceData,
setData,
setNodeValue,
substringData |
Methods inherited from class com.ibm.xml.parser.Child |
appendChild,
clearDigest,
cloneNode,
getAttributes,
getChildNodes,
getDigest,
getFactory,
getFirstChild,
getFirstWithoutReference,
getLastChild,
getLastWithoutReference,
getNextSibling,
getNextWithoutReference,
getOwnerDocument,
getParentNode,
getParentWithoutReference,
getPreviousSibling,
getPreviousWithoutReference,
getUserData,
hasChildNodes,
insertBefore,
makeXPointer,
print,
print,
removeChild,
replaceChild,
searchAncestors,
searchAncestors,
setFactory,
setUserData,
toXMLString,
toXMLString |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TXText(java.lang.String data)
data
- The actual content of the Text Node.Method Detail |
public java.lang.Object clone()
This method is defined by Child.
Child.clone()
public boolean equals(org.w3c.dom.Node arg, boolean deep)
deep
- ignored.public short getNodeType()
This method is defined by DOM.
public java.lang.String getNodeName()
public java.lang.String getText()
This method is defined by Child.
Child.toXMLString(java.io.Writer, java.lang.String)
,
TXCharacterData.getData()
public boolean getIsIgnorableWhitespace()
=true
space is to be preserved;
=false
space is to be ignored.setIsIgnorableWhitespace(boolean)
,
Parser.setPreserveSpace(boolean)
,
TXElement.setPreserveSpace(boolean)
,
TXDocument.printWithFormat(java.io.Writer)
public void setIsIgnorableWhitespace(boolean isIgnorableWhitespace)
By default, this Text Node is not ignorable whitespace. The XML4J parser may, depending on the value if its isPreserveSpace, override this default setting if no significant text is detected for this Text Node.
isIgnorableWhitespace
- =true
space is to be preserved;
=false
space is to be ignored.getIsIgnorableWhitespace()
,
Parser.setPreserveSpace(boolean)
,
TXElement.setPreserveSpace(boolean)
,
TXDocument.printWithFormat(java.io.Writer)
public java.lang.String getLanguage()
xml:lang
attribute) in
use for this Text Node. If this Text Node has no explicitly defined language attribute,
Parent Nodes will be recursively checked.public void splice(org.w3c.dom.Element element, int offset, int count) throws java.lang.IllegalArgumentException, java.lang.RuntimeException
element
- The Element to insert in the tree; this instance must be an instance of TXElement.offset
- 0-based offset into existing character data in this Text Node.count
- Number of characters to copy to Child Text Node of Element.public org.w3c.dom.Text splitText(int offset) throws org.w3c.dom.DOMException
This method is defined by DOM.
public static java.lang.String trim(java.lang.String string)
string
- String to be trimmed.public static java.lang.String trim(java.lang.String string, boolean trimHead, boolean trimTail)
string
- String to be trimmed.trimHead
- Trim leading whitespace?trimTail
- Trim trailing whitespace?public static java.lang.String makePrintable(java.lang.String string)
string
- String to translate.public void acceptPre(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
public void acceptPost(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
|
XML for Java Compatibility API 2.0.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |