Class TextNode

java.lang.Object
com.nomagic.magicreport.engine.xml.TextNode
All Implemented Interfaces:
Node, Serializable

@OpenApiAll public class TextNode extends Object implements Node, Serializable
The Text node represents the textual content (termed character data in XML) of an Element or Attribute.
Since:
Jun 1, 2009
See Also:
  • Constructor Details

    • TextNode

      public TextNode()
      Create a text node.
    • TextNode

      public TextNode(String text)
      Create a text node with text content.
      Parameters:
      text - text content.
  • Method Details

    • getContent

      public StringBuilder getContent()
      Return a content.
      Returns:
      the content
    • appendContent

      public void appendContent(char[] str, int offset, int len)
      Append a content.
      Parameters:
      str - the characters to be appended.
      offset - the index of the first char to append.
      len - the number of chars to append.
    • getChildNodes

      public Collection<Node> getChildNodes()
      Return a child.
      Specified by:
      getChildNodes in interface Node
      Returns:
      the child
    • toString

      public String toString()
      Return string represents this object.
      Overrides:
      toString in class Object
      Returns:
      a string represents this object
    • setParentNode

      public void setParentNode(Node e)
      Set a parent of this node.
      Specified by:
      setParentNode in interface Node
      Parameters:
      e - a node.
    • getParentNode

      public Node getParentNode()
      Return the parent of this node.
      Specified by:
      getParentNode in interface Node
      Returns:
      the parent
    • appendChild

      public void appendChild(Node e)
      Adds the node newChild to the end of the list of children of this node.
      Specified by:
      appendChild in interface Node
      Parameters:
      e - a child element
    • removeChild

      public Node removeChild(Node oldChild)
      Removes the child node indicated by oldChild from the list of children, and returns it.
      Specified by:
      removeChild in interface Node
      Parameters:
      oldChild - The node being removed.
      Returns:
      the node removed.
    • insertBefore

      public void insertBefore(Node newChild, int index)
      Inserts the node newChild before the child index.
      Specified by:
      insertBefore in interface Node
      Parameters:
      newChild - the node to insert
      index - the reference child index