All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xg.xg_Attribute

java.lang.Object
   |
   +----xg.xg_Attribute

public class xg_Attribute
extends Object
An attribute of an entity, which is basically a name and a value. It also has several whitespace values, to allow it to be rewritten exactly as read, as follows: [PrecedingWhitespace][Name][WhitespaceBeforeEquals]=[WhitespaceAfterEquals]"[Value]"

Note that this class implements all the methods of the DOM org.w3c.dom.AttributeList interface, but since the rest of xg does not, references to the DOM interfaces is commented out to allow xg to run without the DOM interfaces being present.


Constructor Index

 o xg_Attribute()
Default constructor.
 o xg_Attribute(String, String)
Constructor: create an attribute with a name and value and the simplest possible whitespace to make it well-formed: one preceding space, and no whitespace around the '='.
 o xg_Attribute(xg_Value, xg_Value, xg_Value)
Constructor: create an attribute based on three values, which represent the name, equals and value parts.

Method Index

 o duplicate()
Create a new xg_Attribute which is exactly the same as this one.
 o getName()
Get the name of this attribute.
 o getPrecedingWhitespace()
Get the value of the preceding whitespace.
 o getSpecified()
Get the flag which indicates whether this attribute's value has been set explicitly.
 o getValue()
Get the value of this attribute.
 o save(Writer)
Save this attribute in InputWriter in XML source form: Name = "Value"
 o setName(String)
Set the name of this attribute.
 o setPrecedingWhitespace(String)
Set the value of the preceding whitespace.
 o setSpecified(boolean)
Set the flag which indicates whether this attribute's value has been set explicitly.
 o setValue(String)
Set the value of this attribute.
 o setWhitespaceAfterEquals(String)
Set the value of the whitespace after the equals sign.
 o setWhitespaceBeforeEquals(String)
Set the value of the whitespace before the equals sign.
 o toString()
Return a string representation of the attribute (intended for use as debug output).

Constructors

 o xg_Attribute
 public xg_Attribute(xg_Value InputNameValue,
                     xg_Value InputEqualsValue,
                     xg_Value InputValueValue)
Constructor: create an attribute based on three values, which represent the name, equals and value parts. Each 'value' can contain preceding whitespace.

Parameters:
InputNameValue - Value for the name of the attribute
InputEqualsValue - Value for the '=' of the attribute
InputValueValue - Value for the value of the attribute
 o xg_Attribute
 public xg_Attribute(String InputAttName,
                     String InputAttValue)
Constructor: create an attribute with a name and value and the simplest possible whitespace to make it well-formed: one preceding space, and no whitespace around the '='.

Parameters:
InputAttName - The name of this attribute
InputAttValue - The value of this attribute
 o xg_Attribute
 public xg_Attribute()
Default constructor.

Methods

 o save
 public void save(Writer InputWriter) throws IOException
Save this attribute in InputWriter in XML source form: Name = "Value"

Parameters:
InputWriter - The writer to which the XML will be written
 o duplicate
 public xg_Attribute duplicate()
Create a new xg_Attribute which is exactly the same as this one.

Returns:
A duplicate attribute
 o setName
 public void setName(String InputAttName)
Set the name of this attribute.

Parameters:
InputName - Name of the attribute
 o setValue
 public void setValue(String InputAttValue)
Set the value of this attribute.

Parameters:
InputAttValue - Value of the attribute
 o setPrecedingWhitespace
 public void setPrecedingWhitespace(String InputPrecedingWhitespace)
Set the value of the preceding whitespace.

Parameters:
InputPrecedingWhitespace - Value of the preceding whitespace
 o setWhitespaceBeforeEquals
 public void setWhitespaceBeforeEquals(String InputWhitespaceBeforeEquals)
Set the value of the whitespace before the equals sign.

Parameters:
InputWhitespaceBeforeEquals - Value of the whitespace before the equals sign
 o setWhitespaceAfterEquals
 public void setWhitespaceAfterEquals(String InputWhitespaceAfterEquals)
Set the value of the whitespace after the equals sign.

Parameters:
InputWhitespaceAfterEquals - Value of the whitespace after the equals sign
 o setSpecified
 public void setSpecified(boolean InputAttSpecifiedFlag)
Set the flag which indicates whether this attribute's value has been set explicitly. (Implements org.w3c.dom.Attribute.setSpecified().)

Parameters:
InputAttSpecifiedFlag - - if true it indicates that the value of this attribute has been set explicitly; if false then if it is deemed to have been assigned its default value.
 o getName
 public String getName()
Get the name of this attribute. (Implements org.w3c.dom.Attribute.getName().)

Returns:
The name of the attribute.
 o getValue
 public String getValue()
Get the value of this attribute. (Implements org.w3c.dom.Attribute.getValue().)

Returns:
The value of the attribute.
 o getSpecified
 public boolean getSpecified()
Get the flag which indicates whether this attribute's value has been set explicitly. (Implements org.w3c.dom.Attribute.getSpecified().)

Returns:
true if the value of this attribute has been set explicitly; false if it has been assigned its default value.
 o getPrecedingWhitespace
 public String getPrecedingWhitespace()
Get the value of the preceding whitespace.

Returns:
String value or null
 o toString
 public String toString()
Return a string representation of the attribute (intended for use as debug output). (Implements org.w3c.dom.Attribute.getValue().)

Returns:
String representing the attribute name and value.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index