public class BasicNode extends java.lang.Object implements Node
Modifier and Type | Field and Description |
---|---|
private Token |
token |
private XMLTokenizer.Type |
type |
private java.lang.String |
value |
Constructor and Description |
---|
BasicNode(Token token) |
BasicNode(XMLTokenizer.Type type,
java.lang.String text) |
Modifier and Type | Method and Description |
---|---|
BasicNode |
copy()
Simulate clone()
|
BasicNode |
copy(Node orig)
Copy all data from
orig into this |
BasicNode |
createClone()
Simulate clone()
|
int |
getEndOffset() |
int |
getStartOffset()
The start offset of the node in the XML source or -1
|
Token |
getToken()
Get the token (mainly for error handling)
|
XMLTokenizer.Type |
getType()
Get the node type
|
java.lang.String |
getValue() |
protected void |
setType(XMLTokenizer.Type type) |
void |
setValue(java.lang.String value) |
java.lang.String |
toString() |
java.lang.String |
toXML()
Convert this node to a string.
|
static java.lang.String |
toXML(Node n)
Helper method for
String toXML() to handle the
IOException that StringWriter
will never throw. |
BasicNode |
toXML(XMLWriter writer)
Append the content of this node to
writer |
private Token token
private XMLTokenizer.Type type
private java.lang.String value
public BasicNode(Token token)
public BasicNode(XMLTokenizer.Type type, java.lang.String text)
protected void setType(XMLTokenizer.Type type)
public XMLTokenizer.Type getType()
Node
public Token getToken()
public int getStartOffset()
public int getEndOffset()
public java.lang.String getValue()
public void setValue(java.lang.String value)
public BasicNode toXML(XMLWriter writer) throws java.io.IOException
writer
public java.lang.String toXML()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toXML(Node n)
String toXML()
to handle the
IOException
that StringWriter
will never throw.public BasicNode createClone()
Node
createClone
in interface Node
public BasicNode copy(Node orig)
Node
orig
into this