org.eigenbase.xom
Interface NodeDef

All Known Implementing Classes:
CdataDef, CommentDef, ElementDef, GenericDef, MetaDef.Any, MetaDef.Array, MetaDef.Attribute, MetaDef.CData, MetaDef.Class, MetaDef.Content, MetaDef.Definition, MetaDef.Element, MetaDef.FullDefinition, MetaDef.Import, MetaDef.Model, MetaDef.Object, MetaDef.Plugin, MetaDef.StringElement, ResourceDef.Code, ResourceDef.Exception, ResourceDef.Message, ResourceDef.Property, ResourceDef.Resource, ResourceDef.ResourceBundle, ResourceDef.Text, TextDef, WrapperElementDef

public interface NodeDef

NodeDef represents a node in a parse tree. It is a base class for ElementDef, TextDef, etc.

Since:
11 October, 2001
Author:
jhyde
 

Method Summary
 void display(PrintWriter out, 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.
 

Method Detail

getName

String getName()
Returns the name of this node's tag.


getType

int getType()
Returns the type of this element. Values are as for DOMWrapper.getType().


getText

String getText()
Returns the text inside this node.


getChildren

NodeDef[] getChildren()
Returns the children of this node.


displayXML

void displayXML(XMLOutput out,
                int indent)
Outputs this element definition in XML to any XMLOutput.

Parameters:
out - the XMLOutput class to display the XML

display

void display(PrintWriter out,
             int indent)
Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.

Parameters:
out - the PrintWriter to which to write this NodeDef.
indent - the indentation level for the printout.

getWrapper

DOMWrapper getWrapper()
Retrieves the DOMWrapper which was used to create this node. Only works if this nodes's MetaDef.FullDefinition.keepDef was true (or, if it is not set, if the default MetaDef.Model.defaultKeepDef is true); otherwise, returns null.

Returns:
wrapper underlying this node

getLocation

Location getLocation()
Returns the location of this element in its document.

Returns:
location of this element, or null if location is not available

SourceForge.net_Logo