Package org.eigenbase.xom
Class TextDef
java.lang.Object
org.eigenbase.xom.TextDef
- All Implemented Interfaces:
NodeDef
- Direct Known Subclasses:
CdataDef
,CommentDef
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: '<'-- 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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
display
(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[]
Returns the children of this node.Returns the location of this element in its document.getName()
Returns the name of this node's tag.getText()
Returns the text inside this node.int
getType()
Returns the type of this element.Retrieves theDOMWrapper
which was used to create this node.
-
Field Details
-
s
-
asIs
boolean asIsWhether to print the data as is -- never quote as a CDATA section. Useful if the fragment contains a valid XML string.
-
-
Constructor Details
-
TextDef
public TextDef() -
TextDef
-
TextDef
-
TextDef
-
TextDef
- Throws:
XOMException
-
-
Method Details
-
getName
Description copied from interface:NodeDef
Returns the name of this node's tag. -
getText
Description copied from interface:NodeDef
Returns the text inside this node. -
getChildren
Description copied from interface:NodeDef
Returns the children of this node.- Specified by:
getChildren
in interfaceNodeDef
-
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
Description copied from interface:NodeDef
Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting. -
displayXML
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
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
-