de.pdark.decentxml
Class BasicNode

java.lang.Object
  extended by de.pdark.decentxml.BasicNode
All Implemented Interfaces:
Node
Direct Known Subclasses:
Attribute, Comment, DocType, DocTypeAttributeList, DocTypeElement, DocTypeEntity, DocTypeNotation, DocTypeText, Entity, ProcessingInstruction, Text

public class BasicNode
extends java.lang.Object
implements Node

The parent class for all nodes in the XML document.

Author:
digulla

Constructor Summary
BasicNode(Token token)
           
BasicNode(XMLTokenizer.Type type, java.lang.String text)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicNode

public BasicNode(Token token)

BasicNode

public BasicNode(XMLTokenizer.Type type,
                 java.lang.String text)
Method Detail

setType

protected void setType(XMLTokenizer.Type type)

getType

public XMLTokenizer.Type getType()
Description copied from interface: Node
Get the node type

Specified by:
getType in interface Node

getToken

public Token getToken()
Get the token (mainly for error handling)


getStartOffset

public int getStartOffset()
The start offset of the node in the XML source or -1


getEndOffset

public int getEndOffset()

getValue

public java.lang.String getValue()

setValue

public void setValue(java.lang.String value)

toXML

public BasicNode toXML(XMLWriter writer)
                throws java.io.IOException
Append the content of this node to writer

Specified by:
toXML in interface Node
Throws:
java.io.IOException

toXML

public java.lang.String toXML()
Convert this node to a string.

Specified by:
toXML in interface Node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXML

public static java.lang.String toXML(Node n)
Helper method for String toXML() to handle the IOException that StringWriter will never throw.


createClone

public BasicNode createClone()
Description copied from interface: Node
Simulate clone()

Specified by:
createClone in interface Node

copy

public BasicNode copy(Node orig)
Description copied from interface: Node
Copy all data from orig into this

Specified by:
copy in interface Node

copy

public BasicNode copy()
Description copied from interface: Node
Simulate clone()

Specified by:
copy in interface Node


Copyright © 2008-2011. All Rights Reserved.