|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.twicom.qdparser.Element com.twicom.qdparser.TextElement
public class TextElement
An XML element that simply contains text. This is normally a child element of
TaggedElement
.
Field Summary | |
---|---|
(package private) java.lang.Integer |
integer
|
(package private) java.lang.String |
string
The value of the TextElement. |
Constructor Summary | |
---|---|
TextElement(int value)
Constructs a TextElement using an integer. |
|
TextElement(java.lang.String string)
Constructs a TextElement using a string |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
boolean |
getCData()
Gets the value of the CDATA boolean |
int |
getInteger()
Gets the value of this TextElement as an integer. |
boolean |
isNumber()
checks to see if this TextElement contains a numeric value |
void |
setCData(boolean cdata)
Sets this element to print as a CDATA element |
void |
setValue(int value)
Sets the value of this TextElement using an integer |
void |
setValue(java.lang.String value)
Sets the value of this TextElement using a String |
java.lang.String |
toString()
|
protected java.lang.StringBuffer |
toString(java.lang.StringBuffer sb,
boolean formatted,
int level)
Internal method used recursively to format XML with appropriate indentation. |
Methods inherited from class com.twicom.qdparser.Element |
---|
newElement, quote, toString, unquote |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.lang.String string
java.lang.Integer integer
Constructor Detail |
---|
public TextElement(java.lang.String string)
string
- public TextElement(int value)
value
- Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class Element
java.lang.CloneNotSupportedException
public void setValue(java.lang.String value)
value
- the value to store in this TextElementpublic void setValue(int value)
value
- the value to store in this TextElementpublic void setCData(boolean cdata)
cdata
- true if it should be printed as a CDATA elementpublic boolean getCData()
public boolean isNumber()
public int getInteger()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.StringBuffer toString(java.lang.StringBuffer sb, boolean formatted, int level)
Element
toString
in class Element
sb
- TODOformatted
- whether to return formatted XML source. If true, the source is
pretty-printed with new lines and indentation. If false, the XML
string is returned as one long, unformatted line.level
- the indentation level used to write leading spaces
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |