com.g11ntoolkit.parser.xml
Class LTSAXAttributes

java.lang.Object
  |
  +--com.g11ntoolkit.parser.xml.LTSAXAttributes
All Implemented Interfaces:
org.xml.sax.Attributes

public class LTSAXAttributes
extends java.lang.Object
implements org.xml.sax.Attributes

Implements SAX Attributes for use in G11NToolKit.

Version:
2005/06/30
Author:
Bill Rich, Wilandra Consulting LLC
Copyright © 2001-2005, Wilandra Consulting LLC. All rights reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See License Agreement.

See Also:
LTAttributeNode

Field Summary
private  LTAttributeNode head
          Contains the first (Head) attribute node.
private  int length
          Contains the number of attribute nodes in the list.
private  LTAttributeNode tail
          Contains the last (Tail) attribute node.
 
Constructor Summary
LTSAXAttributes()
           
 
Method Summary
 void addAttribute(java.lang.String rawname, java.lang.String type, java.lang.String value)
          Adds an attribute.
 void addAttribute(java.lang.String uri, java.lang.String localname, java.lang.String rawname, java.lang.String type, java.lang.String value)
          Adds an attribute.
 int getIndex(java.lang.String rawname)
          Returns the index of the specified attribute.
 int getIndex(java.lang.String uri, java.lang.String localname)
          Returns the index of the specified attribute.
 int getLength()
          Returns the number of attribute nodes in the list.
 java.lang.String getLocalName(int index)
          Returns the attribute local name based on the specified attribute node index.
private  LTAttributeNode getLTAttributeNode(java.lang.String rawname)
          Returns the first attribute node with the specified raw name.
 LTAttributeNode getLTAttributeNode(java.lang.String uri, java.lang.String localname)
          Returns the first attribute node with the specified uri and local name.
private  LTAttributeNode getLTAttributeNodeAt(int i)
          Returns the attribute node at the specified index.
 java.lang.String getQName(int index)
          Returns the attribute raw name based on the specified attribute node index.
 java.lang.String getType(int index)
          Returns the attribute type based on the specified attribute node index.
 java.lang.String getType(java.lang.String rawname)
          Returns the attribute type based on the specified raw name attribute.
 java.lang.String getType(java.lang.String uri, java.lang.String localname)
          Returns the attribute type based on the specified uri and local name attributes.
 java.lang.String getURI(int index)
          Returns the attribute URI based on the specified attribute node index.
 java.lang.String getValue(int index)
          Returns the attribute value based on the specified attribute node index.
 java.lang.String getValue(java.lang.String rawname)
          Returns the attribute value based on the specified raw name attribute.
 java.lang.String getValue(java.lang.String uri, java.lang.String localname)
          Returns the attribute value based on the specified uri and local name attributes.
 void insertAttributeAt(int index, java.lang.String rawname, java.lang.String type, java.lang.String value)
          Inserts an attribute at the specified attribute node index.
 void insertAttributeAt(int index, java.lang.String uri, java.lang.String localname, java.lang.String rawname, java.lang.String type, java.lang.String value)
          Inserts an attribute at the specified attribute node index.
 void removeAttribute(java.lang.String rawname)
          Removes the attribute with the specified raw name.
 void removeAttribute(java.lang.String uri, java.lang.String localname)
          Removes the attribute with the specified uri and local name.
 void removeAttributeAt(int index)
          Removes the attribute at the specified attribute node index.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

private LTAttributeNode head
Contains the first (Head) attribute node.


tail

private LTAttributeNode tail
Contains the last (Tail) attribute node.


length

private int length
Contains the number of attribute nodes in the list.

Constructor Detail

LTSAXAttributes

public LTSAXAttributes()
Method Detail

getLength

public int getLength()
Returns the number of attribute nodes in the list.

Specified by:
getLength in interface org.xml.sax.Attributes
Returns:
an int containing the current number of attribute nodes

getIndex

public int getIndex(java.lang.String rawname)
Returns the index of the specified attribute.

Specified by:
getIndex in interface org.xml.sax.Attributes
Parameters:
rawname - a String specifying the attribute
Returns:
an int containing the index for the specified attribute

getIndex

public int getIndex(java.lang.String uri,
                    java.lang.String localname)
Returns the index of the specified attribute.

Specified by:
getIndex in interface org.xml.sax.Attributes
Parameters:
uri - a String specifying the uri for the attribute
localname - a String specifying the name of the attribute
Returns:
an int containing the index for the specified attribute

getURI

public java.lang.String getURI(int index)
Returns the attribute URI based on the specified attribute node index.

Specified by:
getURI in interface org.xml.sax.Attributes
Parameters:
index - an int specifying the index for the uri attribute
Returns:
a String containing the uri attribute at the specified index

getLocalName

public java.lang.String getLocalName(int index)
Returns the attribute local name based on the specified attribute node index.

Specified by:
getLocalName in interface org.xml.sax.Attributes
Parameters:
index - an int specifying the index for the local name attribute
Returns:
a String containing the local name attribute at the specified index

getQName

public java.lang.String getQName(int index)
Returns the attribute raw name based on the specified attribute node index.

Specified by:
getQName in interface org.xml.sax.Attributes
Parameters:
index - an int specifying the index for the raw name attribute
Returns:
a String containing the raw name attribute at the specified index

getType

public java.lang.String getType(int index)
Returns the attribute type based on the specified attribute node index.

Specified by:
getType in interface org.xml.sax.Attributes
Parameters:
index - an int specifying the index for the type attribute
Returns:
a String containing the type attribute at the specified index

getType

public java.lang.String getType(java.lang.String uri,
                                java.lang.String localname)
Returns the attribute type based on the specified uri and local name attributes.

Specified by:
getType in interface org.xml.sax.Attributes
Parameters:
uri - a String specifying the uri for the type attribute
localname - a String specifying the local name for the type attribute
Returns:
a String containing the type attribute at the specified uri and local name

getType

public java.lang.String getType(java.lang.String rawname)
Returns the attribute type based on the specified raw name attribute.

Specified by:
getType in interface org.xml.sax.Attributes
Parameters:
rawname - a String specifying the raw name for the type attribute
Returns:
a String containing the type attribute at the specified raw name

getValue

public java.lang.String getValue(int index)
Returns the attribute value based on the specified attribute node index.

Specified by:
getValue in interface org.xml.sax.Attributes
Parameters:
index - an int specifying the index for the value attribute
Returns:
a String containing the value attribute at the specified index

getValue

public java.lang.String getValue(java.lang.String uri,
                                 java.lang.String localname)
Returns the attribute value based on the specified uri and local name attributes.

Specified by:
getValue in interface org.xml.sax.Attributes
Parameters:
uri - a String specifying the uri for the value attribute
localname - a String specifying the local name for the value attribute
Returns:
a String containing the value attribute at the specified uri and local name

getValue

public java.lang.String getValue(java.lang.String rawname)
Returns the attribute value based on the specified raw name attribute.

Specified by:
getValue in interface org.xml.sax.Attributes
Parameters:
rawname - a String specifying the raw name for the value attribute
Returns:
a String containing the value attribute at the specified raw name

addAttribute

public void addAttribute(java.lang.String rawname,
                         java.lang.String type,
                         java.lang.String value)
Adds an attribute.

Parameters:
rawname - a String specifying the raw name of the attribute
type - a String specifying the type of the attribute
value - a String specifying the value of the attribute

addAttribute

public void addAttribute(java.lang.String uri,
                         java.lang.String localname,
                         java.lang.String rawname,
                         java.lang.String type,
                         java.lang.String value)
Adds an attribute.

Parameters:
uri - a String specifying the uri of the attribute
localname - a String specifying the local name of the attribute
rawname - a String specifying the raw name of the attribute
type - a String specifying the type of the attribute
value - a String specifying the value of the attribute

insertAttributeAt

public void insertAttributeAt(int index,
                              java.lang.String rawname,
                              java.lang.String type,
                              java.lang.String value)
Inserts an attribute at the specified attribute node index.

Parameters:
index - an int specifying the index at which the attribute will be inserted
rawname - a String specifying the raw name of the attribute
type - a String specifying the type of the attribute
value - a String specifying the value of the attribute

insertAttributeAt

public void insertAttributeAt(int index,
                              java.lang.String uri,
                              java.lang.String localname,
                              java.lang.String rawname,
                              java.lang.String type,
                              java.lang.String value)
Inserts an attribute at the specified attribute node index.

Parameters:
index - an int specifying the index at which the attribute will be inserted
uri - a String specifying the uri of the attribute
localname - a String specifying the local name of the attribute
rawname - a String specifying the raw name of the attribute
type - a String specifying the type of the attribute
value - a String specifying the value of the attribute

removeAttributeAt

public void removeAttributeAt(int index)
Removes the attribute at the specified attribute node index.

Parameters:
index - an int specifying the index of the attribute to be removed

removeAttribute

public void removeAttribute(java.lang.String rawname)
Removes the attribute with the specified raw name.

Parameters:
rawname - a String specifying the raw name of the attribute to be removed

removeAttribute

public void removeAttribute(java.lang.String uri,
                            java.lang.String localname)
Removes the attribute with the specified uri and local name.

Parameters:
uri - a String specifying the uri of the attribute to be removed
localname - a String specifying the local name of the attribute to be removed

getLTAttributeNodeAt

private LTAttributeNode getLTAttributeNodeAt(int i)
Returns the attribute node at the specified index.

Parameters:
i - an int specifying the index of the node
Returns:
a LTAttributeNode containing the desired node

getLTAttributeNode

public LTAttributeNode getLTAttributeNode(java.lang.String uri,
                                          java.lang.String localname)
Returns the first attribute node with the specified uri and local name.

Parameters:
uri - a String specifying the uri of the node
localname - a String specifying the local name of the node
Returns:
a LTAttributeNode containing the desired node

getLTAttributeNode

private LTAttributeNode getLTAttributeNode(java.lang.String rawname)
Returns the first attribute node with the specified raw name.

Parameters:
rawname - a String specifying the raw name of the node
Returns:
a LTAttributeNode containing the desired node

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a String containing contents of this object in a String form