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.
-
xg_Attribute()
- Default constructor.
-
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 '='.
-
xg_Attribute(xg_Value, xg_Value, xg_Value)
- Constructor: create an attribute based on three values, which represent the
name, equals and value parts.
-
duplicate()
- Create a new xg_Attribute which is exactly the same as this one.
-
getName()
- Get the name of this attribute.
-
getPrecedingWhitespace()
- Get the value of the preceding whitespace.
-
getSpecified()
- Get the flag which indicates whether this attribute's value has been set
explicitly.
-
getValue()
- Get the value of this attribute.
-
save(Writer)
- Save this attribute in InputWriter in XML source form:
Name = "Value"
-
setName(String)
- Set the name of this attribute.
-
setPrecedingWhitespace(String)
- Set the value of the preceding whitespace.
-
setSpecified(boolean)
- Set the flag which indicates whether this attribute's value has been set
explicitly.
-
setValue(String)
- Set the value of this attribute.
-
setWhitespaceAfterEquals(String)
- Set the value of the whitespace after the equals sign.
-
setWhitespaceBeforeEquals(String)
- Set the value of the whitespace before the equals sign.
-
toString()
- Return a string representation of the attribute (intended for use as debug
output).
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
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
xg_Attribute
public xg_Attribute()
- Default constructor.
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
duplicate
public xg_Attribute duplicate()
- Create a new xg_Attribute which is exactly the same as this one.
- Returns:
- A duplicate attribute
setName
public void setName(String InputAttName)
- Set the name of this attribute.
- Parameters:
- InputName - Name of the attribute
setValue
public void setValue(String InputAttValue)
- Set the value of this attribute.
- Parameters:
- InputAttValue - Value of the attribute
setPrecedingWhitespace
public void setPrecedingWhitespace(String InputPrecedingWhitespace)
- Set the value of the preceding whitespace.
- Parameters:
- InputPrecedingWhitespace - Value of the preceding whitespace
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
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
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.
getName
public String getName()
- Get the name of this attribute. (Implements org.w3c.dom.Attribute.getName().)
- Returns:
- The name of the attribute.
getValue
public String getValue()
- Get the value of this attribute. (Implements org.w3c.dom.Attribute.getValue().)
- Returns:
- The value of the attribute.
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.
getPrecedingWhitespace
public String getPrecedingWhitespace()
- Get the value of the preceding whitespace.
- Returns:
- String value or null
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