org.gjt.xpp
Interface XmlStartTag

All Superinterfaces:
XmlTag
All Known Subinterfaces:
XmlNode, XmlPullNode

public interface XmlStartTag
extends XmlTag

This class represents abstract functionality necessary to to persist XML Pull Parser events.

Author:
Aleksander Slominski
See Also:
XmlTag, XmlNode

Method Summary
 void addAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String rawName, java.lang.String value)
          parameters modeled after SAX2 attribute approach
 void addAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String rawName, java.lang.String value, boolean isNamespaceDeclaration)
          Parameter isNamespaceDeclaration if true indicates that attribute is related to namespace management and may be ignored by normal processing
 void ensureAttributesCapacity(int minCapacity)
          Pre-allocate if necessary tag data structure to hold at least minCapacity attributes .
 int getAttributeCount()
          Returns the number of attributes on the current element
 java.lang.String getAttributeLocalName(int index)
          Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled.
 java.lang.String getAttributeNamespaceUri(int index)
          Returns the namespace URI of the specified attribute number index (starts from 0).
 java.lang.String getAttributePrefix(int index)
          Returns the prefix of the specified attribute Returns null if invalid index or if element has no prefix.
 java.lang.String getAttributeRawName(int index)
          Returns the raw name of the specified attribute Returns null if invalid index.
 java.lang.String getAttributeValue(int index)
          Returns the given attributes value Returns null if invalid index.
 java.lang.String getAttributeValueFromName(java.lang.String namespaceUri, java.lang.String localName)
          Returns the given attributes value
 java.lang.String getAttributeValueFromRawName(java.lang.String rawName)
          Returns the given attributes value Returns null if no attribute with rawName.
 boolean isAttributeNamespaceDeclaration(int index)
          Return true if attribute at index is namespace declaration such as xmlns='...' or xmlns:prefix='...'
 boolean removeAttributeByName(java.lang.String uri, java.lang.String localName)
          This method tries to remove attribute identified by namespace uti and local name.
 boolean removeAttributeByRawName(java.lang.String rawName)
          This method tries to remove attribute identified by raw name.
 void removeAttributes()
          remove all atribute
 void resetStartTag()
          Clear all Tag state to default values.
 
Methods inherited from interface org.gjt.xpp.XmlTag
getLocalName, getNamespaceUri, getPrefix, getRawName, modifyTag, resetTag
 

Method Detail

resetStartTag

public void resetStartTag()
Clear all Tag state to default values.


getAttributeCount

public int getAttributeCount()
Returns the number of attributes on the current element


getAttributeNamespaceUri

public java.lang.String getAttributeNamespaceUri(int index)
Returns the namespace URI of the specified attribute number index (starts from 0). (meaningful only if namespaces enabled) Returns null if invalid index.


getAttributeLocalName

public java.lang.String getAttributeLocalName(int index)
Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled. Returns null if invalid index.


getAttributePrefix

public java.lang.String getAttributePrefix(int index)
Returns the prefix of the specified attribute Returns null if invalid index or if element has no prefix.


getAttributeRawName

public java.lang.String getAttributeRawName(int index)
Returns the raw name of the specified attribute Returns null if invalid index.


getAttributeValue

public java.lang.String getAttributeValue(int index)
Returns the given attributes value Returns null if invalid index.


getAttributeValueFromRawName

public java.lang.String getAttributeValueFromRawName(java.lang.String rawName)
Returns the given attributes value Returns null if no attribute with rawName.


getAttributeValueFromName

public java.lang.String getAttributeValueFromName(java.lang.String namespaceUri,
                                                  java.lang.String localName)
Returns the given attributes value


isAttributeNamespaceDeclaration

public boolean isAttributeNamespaceDeclaration(int index)
Return true if attribute at index is namespace declaration such as xmlns='...' or xmlns:prefix='...'


addAttribute

public void addAttribute(java.lang.String namespaceUri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         java.lang.String value)
                  throws XmlPullParserException
parameters modeled after SAX2 attribute approach

Throws:
XmlPullParserException

addAttribute

public void addAttribute(java.lang.String namespaceUri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         java.lang.String value,
                         boolean isNamespaceDeclaration)
                  throws XmlPullParserException
Parameter isNamespaceDeclaration if true indicates that attribute is related to namespace management and may be ignored by normal processing

NOTE: this class has no support for resolving namespaces and such support may be added later (see XmlNode and namespaces methids)

Throws:
XmlPullParserException

ensureAttributesCapacity

public void ensureAttributesCapacity(int minCapacity)
                              throws XmlPullParserException
Pre-allocate if necessary tag data structure to hold at least minCapacity attributes .

Throws:
XmlPullParserException

removeAttributes

public void removeAttributes()
                      throws XmlPullParserException
remove all atribute

Throws:
XmlPullParserException

removeAttributeByName

public boolean removeAttributeByName(java.lang.String uri,
                                     java.lang.String localName)
                              throws XmlPullParserException
This method tries to remove attribute identified by namespace uti and local name.

Returns:
true if attribute was removed or false otherwise.
Throws:
XmlPullParserException

removeAttributeByRawName

public boolean removeAttributeByRawName(java.lang.String rawName)
                                 throws XmlPullParserException
This method tries to remove attribute identified by raw name.

Returns:
true if attribute was removed or false otherwise.
Throws:
XmlPullParserException


Copyright (c) 2003 IU Extreme! Lab http://www.extreme.indiana.edu/ All Rights Reserved.

Note this package is deprecated by XPP3 that implements XmlPull API