Class BasicNode

java.lang.Object
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 Object implements Node
The parent class for all nodes in the XML document.
  • Field Details

  • Constructor Details

  • Method Details

    • 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 String getValue()
    • setValue

      public void setValue(String value)
    • toXML

      public BasicNode toXML(XMLWriter writer) throws IOException
      Append the content of this node to writer
      Specified by:
      toXML in interface Node
      Throws:
      IOException
    • toXML

      public String toXML()
      Convert this node to a string.
      Specified by:
      toXML in interface Node
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXML

      public static 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