Class TextDef

java.lang.Object
org.eigenbase.xom.TextDef
All Implemented Interfaces:
NodeDef
Direct Known Subclasses:
CdataDef, CommentDef

public class TextDef extends Object implements NodeDef
A TextDef represents piece of textual data in an XML document. Free text (such as Some text) is represented by an actual TextDef; comments (such as invalid input: '&lt'-- a comment -->) by derived class CommentDef; and CDATA sections (such as <![CDATA[Some text]]>) by derived class CdataDef.
Since:
5 October, 2001
Version:
$Id: //open/util/resgen/src/org/eigenbase/xom/TextDef.java#4 $
Author:
jhyde
  • Field Details

    • s

      public String s
    • asIs

      boolean asIs
      Whether to print the data as is -- never quote as a CDATA section. Useful if the fragment contains a valid XML string.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: NodeDef
      Returns the name of this node's tag.
      Specified by:
      getName in interface NodeDef
    • getText

      public String getText()
      Description copied from interface: NodeDef
      Returns the text inside this node.
      Specified by:
      getText in interface NodeDef
    • getChildren

      public NodeDef[] getChildren()
      Description copied from interface: NodeDef
      Returns the children of this node.
      Specified by:
      getChildren in interface NodeDef
    • getWrapper

      public DOMWrapper getWrapper()
      Description copied from interface: NodeDef
      Retrieves the DOMWrapper which was used to create this node. Only works if this nodes's MetaDef.Element.keepDef was true (or, if it is not set, if the default MetaDef.Model.defaultKeepDef is true); otherwise, returns null.
      Specified by:
      getWrapper in interface NodeDef
      Returns:
      wrapper underlying this node
    • getType

      public int getType()
      Description copied from interface: NodeDef
      Returns the type of this element. Values are as for DOMWrapper.getType().
      Specified by:
      getType in interface NodeDef
    • display

      public void display(PrintWriter pw, int indent)
      Description copied from interface: NodeDef
      Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.
      Specified by:
      display in interface NodeDef
      Parameters:
      pw - the PrintWriter to which to write this NodeDef.
      indent - the indentation level for the printout.
    • displayXML

      public void displayXML(XMLOutput out, int indent)
      Description copied from interface: NodeDef
      Outputs this element definition in XML to any XMLOutput.
      Specified by:
      displayXML in interface NodeDef
      Parameters:
      out - the XMLOutput class to display the XML
    • getLocation

      public Location getLocation()
      Description copied from interface: NodeDef
      Returns the location of this element in its document.
      Specified by:
      getLocation in interface NodeDef
      Returns:
      location of this element, or null if location is not available