All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xg.xg_Element

java.lang.Object
   |
   +----com.sun.java.swing.tree.DefaultMutableTreeNode
           |
           +----xg.xg_Node
                   |
                   +----xg.xg_Element

public class xg_Element
extends xg_Node
An XML element.


Variable Index

 o ElementAttList
List of this element's attributes.
 o TrailingWhitespace
If this node has whitespace prior to its end tag, this is it.

Constructor Index

 o xg_Element()
Construct an element with no name.
 o xg_Element(String)
Construct an element with a name.

Method Index

 o addAttribute(String, String)
Add an attribute, given its name and value.
 o addAttribute(xg_Attribute)
Add an attribute.
 o getAttList()
Get the list of attributes.
 o getAttribute(String)
Get a named attribute.
 o getAttributes()
Get the collection of attributes this element contains.
 o getAttributeValue(String)
Get the value of a named attribute.
 o getAttributeValueVerified(String)
Get the value of a named attribute, and throwing a verification exception if it is missing.
 o getTrailingWhitespace()
Get the value of the whitespace before the end tag.
 o getType()
Get the type of this node.
 o save(Writer)
Save this element (and its children) in XML source form in InputWriter.
 o saveContent(Writer)
Save this element's content (ie.
 o saveEndTag(Writer)
Save this element's end tag in XML source form in InputWriter.
 o saveStartTag(Writer)
Save this element's start tag in XML source form in InputWriter.
 o setAttList(xg_AttList)
Set the list of attributes.
 o setParentNode(xg_Node)
Set the parent of this node.
 o setTrailingWhitespace(String)
Set the value of the whitespace before the end tag.
 o toString()
Return a string representation of the element (intended for use as debug output).

Variables

 o ElementAttList
 protected xg_AttList ElementAttList
List of this element's attributes.

 o TrailingWhitespace
 protected String TrailingWhitespace
If this node has whitespace prior to its end tag, this is it.

Constructors

 o xg_Element
 public xg_Element()
Construct an element with no name.

 o xg_Element
 public xg_Element(String InputNodeName)
Construct an element with a name.

Parameters:
InputNodeName - The name of the element

Methods

 o save
 public void save(Writer InputWriter) throws IOException
Save this element (and its children) in XML source form in InputWriter.

Parameters:
InputWriter - The writer to which the XML will be written
Overrides:
save in class xg_Node
 o saveStartTag
 public void saveStartTag(Writer InputWriter) throws IOException
Save this element's start tag in XML source form in InputWriter.

Parameters:
InputWriter - The writer to which the XML will be written
 o saveContent
 public void saveContent(Writer InputWriter) throws IOException
Save this element's content (ie. its children).

Parameters:
InputWriter - The writer to which the XML will be written
 o saveEndTag
 public void saveEndTag(Writer InputWriter) throws IOException
Save this element's end tag in XML source form in InputWriter. If this is an empty element, do nothing.

Parameters:
InputWriter - The writer to which the XML will be written
 o addAttribute
 public boolean addAttribute(String InputAttName,
                             String InputAttValue)
Add an attribute, given its name and value.

Parameters:
InputAttName - The name of this attribute
InputAttValue - The value of this attribute
Returns:
Flag indicating success (true) or failure. Failure only occurs if an attribute with this name already exists (which is an XML well-formedness error).
 o addAttribute
 public boolean addAttribute(xg_Attribute InputAttribute)
Add an attribute.

Parameters:
InputAttribute - The attribute to be added
Returns:
Flag indicating success (true) or failure. Failure only occurs if an attribute with this name already exists (which is an XML well-formedness error).
 o setAttList
 public void setAttList(xg_AttList InputAttList)
Set the list of attributes. That is, replace the current attribute list with a completely new one. This is a rather dangerous practice, which should be done only if you know what you're doing. This method was added to support the case where some temporary changes are required, and for the original attribute list to be restored later.

Parameters:
InputAttList - A replacement list of attributes
 o setTrailingWhitespace
 public void setTrailingWhitespace(String InputTrailingWhitespace)
Set the value of the whitespace before the end tag.

Parameters:
InputTrailingWhitespace - Value of the trailing whitespace
 o setParentNode
 public void setParentNode(xg_Node InputParentNode)
Set the parent of this node. This overrides the method in xg_Node in order to set the resolve parent (if the parent is an xg_Element).

Parameters:
ParentNode - The parent of this node
Overrides:
setParentNode in class xg_Node
 o getType
 public int getType()
Get the type of this node.

Returns:
The type of this node
Overrides:
getType in class xg_Node
 o getAttList
 public xg_AttList getAttList()
Get the list of attributes.

Returns:
The list of attributes
 o getAttributeValue
 public String getAttributeValue(String InputAttName)
Get the value of a named attribute.

Parameters:
InputAttName - The name of the attribute required
Returns:
The value of the named attribute (or null if there is no attribute with this name).
 o getAttributeValueVerified
 public String getAttributeValueVerified(String InputAttName) throws xg_VerificationException
Get the value of a named attribute, and throwing a verification exception if it is missing.

Parameters:
InputAttName - The name of the attribute required
Returns:
The value of the named attribute (or null if there is no attribute with this name).
Throws: xg_VerificationException
The attribute is missing
 o getAttribute
 public xg_Attribute getAttribute(String InputAttName)
Get a named attribute.

Parameters:
InputAttName - The name of the attribute required
Returns:
The named attribute (or null if there is no attribute with this name).
 o getAttributes
 public AttributeSet getAttributes()
Get the collection of attributes this element contains.

Returns:
The attributes for the element
Overrides:
getAttributes in class xg_Node
 o getTrailingWhitespace
 public String getTrailingWhitespace()
Get the value of the whitespace before the end tag.

Returns:
String value or null
 o toString
 public String toString()
Return a string representation of the element (intended for use as debug output).

Returns:
String representing the node name and its type.
Overrides:
toString in class xg_Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index