Package org.eigenbase.xom
Class TextDef
- java.lang.Object
-
- org.eigenbase.xom.TextDef
-
- All Implemented Interfaces:
NodeDef
- Direct Known Subclasses:
CdataDef
,CommentDef
public class TextDef extends java.lang.Object implements NodeDef
ATextDef
represents piece of textual data in an XML document. Free text (such asSome text
) is represented by an actualTextDef
; comments (such as<-- a comment -->
) by derived classCommentDef
; and CDATA sections (such as<![CDATA[Some text]]>
) by derived classCdataDef
.- Since:
- 5 October, 2001
- Version:
- $Id: //open/util/resgen/src/org/eigenbase/xom/TextDef.java#4 $
- Author:
- jhyde
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
display(java.io.PrintWriter pw, int indent)
Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.void
displayXML(XMLOutput out, int indent)
Outputs this element definition in XML to any XMLOutput.NodeDef[]
getChildren()
Returns the children of this node.Location
getLocation()
Returns the location of this element in its document.java.lang.String
getName()
Returns the name of this node's tag.java.lang.String
getText()
Returns the text inside this node.int
getType()
Returns the type of this element.DOMWrapper
getWrapper()
Retrieves theDOMWrapper
which was used to create this node.
-
-
-
Constructor Detail
-
TextDef
public TextDef()
-
TextDef
public TextDef(java.lang.String s)
-
TextDef
public TextDef(java.lang.String s, boolean asIs)
-
TextDef
public TextDef(java.lang.String s, boolean asIs, Location location)
-
TextDef
public TextDef(DOMWrapper _def) throws XOMException
- Throws:
XOMException
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:NodeDef
Returns the name of this node's tag.
-
getText
public java.lang.String getText()
Description copied from interface:NodeDef
Returns the text inside this node.
-
getChildren
public NodeDef[] getChildren()
Description copied from interface:NodeDef
Returns the children of this node.- Specified by:
getChildren
in interfaceNodeDef
-
getWrapper
public DOMWrapper getWrapper()
Description copied from interface:NodeDef
Retrieves theDOMWrapper
which was used to create this node. Only works if this nodes'sMetaDef.Element.keepDef
was true (or, if it is not set, if the defaultMetaDef.Model.defaultKeepDef
is true); otherwise, returnsnull
.- Specified by:
getWrapper
in interfaceNodeDef
- Returns:
- wrapper underlying this node
-
getType
public int getType()
Description copied from interface:NodeDef
Returns the type of this element. Values are as forDOMWrapper.getType()
.
-
display
public void display(java.io.PrintWriter pw, int indent)
Description copied from interface:NodeDef
Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.
-
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 interfaceNodeDef
- 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 interfaceNodeDef
- Returns:
- location of this element, or null if location is not available
-
-