|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openadaptor.simplexml.XToken
org.openadaptor.simplexml.XText
public class XText
XText - represents free (non-markup) text in an XML document, or the text inside an XML comment.
Field Summary | |
---|---|
protected java.lang.String |
text
plain text string |
protected java.lang.String |
xmlText
XML encoded string (i.e. |
Fields inherited from class org.openadaptor.simplexml.XToken |
---|
AMPERSAND, log, RCARET |
Constructor Summary | |
---|---|
XText()
Creates a new XText containing null text |
|
XText(java.lang.String text)
Creates a new XText containing text
Note text may be null. |
|
XText(XScanner scanner,
boolean isComment)
|
Method Summary | |
---|---|
boolean |
equals(XToken other)
Returns true if other is an XText with identical text. |
protected void |
fromScanner(XScanner scanner,
boolean isComment)
|
java.lang.String |
getText()
Returns the text of the XText in plaintext form. |
java.lang.String |
getTrimmedText()
Returns the text, with leading and trailing whitepace trimmed. |
java.lang.String |
getXmlText()
Returns the text of the receiver in XML encoded form. |
static XText |
grab(java.lang.String text)
Grabs an uninitialised XText, and sets it to text |
static XText |
grab(XScanner scanner,
boolean isComment)
Grabs an uninitialised XText, and sets it from the scanner |
boolean |
isWhitespace()
Returns true if the text contains only whitespace. |
boolean |
matches(XToken other)
Returns true if other is an XText with identical text. |
protected void |
prepareForRelease()
|
static void |
printStats()
Prints statistics for XTag reuse pool. |
static void |
release(XText txt)
releases an XText for reuse. |
protected void |
setText(java.lang.String s)
|
static java.lang.String |
textToXml(java.lang.String text)
Translates plain text to XML encoded text. |
java.lang.String |
toString()
Returns the XML encoded text of the receiver as a String. |
void |
toWriter(java.io.Writer writer)
Writes the text of receiver onto writer. |
static java.lang.String |
xmlToText(java.lang.String xmlText)
Translates XML free text to plain text. |
Methods inherited from class org.openadaptor.simplexml.XToken |
---|
_grabStringBuffer, _releaseStringBuffer, convertToPlaintext, getClassName, isReleased, printDebug, setReleased, toWriter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String text
protected java.lang.String xmlText
<
becomes <
Constructor Detail |
---|
public XText()
public XText(java.lang.String text)
text
Note text may be null.
text
- text string.public XText(XScanner scanner, boolean isComment) throws java.io.IOException, XParserException
java.io.IOException
XParserException
Method Detail |
---|
public static XText grab(java.lang.String text)
public static XText grab(XScanner scanner, boolean isComment) throws java.io.IOException, XParserException
java.io.IOException
XParserException
public static void release(XText txt)
public static void printStats()
AbstractObjectPool.printStats()
public static java.lang.String xmlToText(java.lang.String xmlText)
xmText
- XML format text
public static java.lang.String textToXml(java.lang.String text)
text
- plain text String.
protected void prepareForRelease()
protected void fromScanner(XScanner scanner, boolean isComment) throws java.io.IOException, XParserException
java.io.IOException
XParserException
protected void setText(java.lang.String s)
public java.lang.String getText()
public java.lang.String getXmlText()
public java.lang.String getTrimmedText()
public boolean isWhitespace()
isWhitespace
in class XToken
public void toWriter(java.io.Writer writer) throws java.io.IOException
toWriter
in class XToken
writer
- Output stream.
java.io.IOException
public java.lang.String toString()
toString
in class XToken
getXmlText()
public boolean matches(XToken other)
matches
in class XToken
other
- XToken to be compared.
other.- See Also:
XToken.isWhitespace()
public boolean equals(XToken other)
equals
in class XToken
other
- XToken to be compared.
other.- See Also:
XToken.matches(org.openadaptor.simplexml.XToken)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |