public class TextDef extends Object implements NodeDef
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 <-- a comment -->)
by derived class CommentDef; and CDATA sections (such as
<![CDATA[Some text]]>) by derived class CdataDef.| Constructor and Description |
|---|
TextDef() |
TextDef(DOMWrapper _def) |
TextDef(String s) |
TextDef(String s,
boolean asIs) |
TextDef(String s,
boolean asIs,
Location location) |
| Modifier and Type | Method and Description |
|---|---|
void |
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[] |
getChildren()
Returns the children of this node.
|
Location |
getLocation()
Returns the location of this element in its document.
|
String |
getName()
Returns the name of this node's tag.
|
String |
getText()
Returns the text inside this node.
|
int |
getType()
Returns the type of this element.
|
DOMWrapper |
getWrapper()
Retrieves the
DOMWrapper which was used to create this
node. |
public String s
public TextDef()
public TextDef(String s)
public TextDef(String s, boolean asIs)
public TextDef(DOMWrapper _def) throws XOMException
XOMExceptionpublic String getName()
NodeDefpublic String getText()
NodeDefpublic NodeDef[] getChildren()
NodeDefgetChildren in interface NodeDefpublic DOMWrapper getWrapper()
NodeDefDOMWrapper 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.getWrapper in interface NodeDefpublic int getType()
NodeDefDOMWrapper.getType().public void display(PrintWriter pw, int indent)
NodeDefpublic void displayXML(XMLOutput out, int indent)
NodeDefdisplayXML in interface NodeDefout - the XMLOutput class to display the XMLpublic Location getLocation()
NodeDefgetLocation in interface NodeDefCopyright © 2012–2022 Julian Hyde. All rights reserved.