public class BasicNode extends Object implements Node
Constructor and Description |
---|
BasicNode(Token token) |
BasicNode(XMLTokenizer.Type type,
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
|
String |
getValue() |
protected void |
setType(XMLTokenizer.Type type) |
void |
setValue(String value) |
String |
toString() |
String |
toXML()
Convert this node to a string.
|
static 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 |
public BasicNode(Token token)
public BasicNode(XMLTokenizer.Type type, String text)
protected void setType(XMLTokenizer.Type type)
public XMLTokenizer.Type getType()
Node
public Token getToken()
public int getStartOffset()
public int getEndOffset()
public String getValue()
public void setValue(String value)
public BasicNode toXML(XMLWriter writer) throws IOException
writer
toXML
in interface Node
IOException
public static 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
Copyright © 2008–2014. All rights reserved.