org.gjt.xpp

Interface XmlStartTag

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
voidaddAttribute(String namespaceUri, String localName, String rawName, String value)
parameters modeled after SAX2 attribute approach
voidaddAttribute(String namespaceUri, String localName, String rawName, String value, boolean isNamespaceDeclaration)
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)

voidensureAttributesCapacity(int minCapacity)
Pre-allocate if necessary tag data structure to hold at least minCapacity attributes .
intgetAttributeCount()
Returns the number of attributes on the current element
StringgetAttributeLocalName(int index)
Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled.
StringgetAttributeNamespaceUri(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.
StringgetAttributePrefix(int index)
Returns the prefix of the specified attribute Returns null if invalid index or if element has no prefix.
StringgetAttributeRawName(int index)
Returns the raw name of the specified attribute Returns null if invalid index.
StringgetAttributeValue(int index)
Returns the given attributes value Returns null if invalid index.
StringgetAttributeValueFromName(String namespaceUri, String localName)
Returns the given attributes value
StringgetAttributeValueFromRawName(String rawName)
Returns the given attributes value Returns null if no attribute with rawName.
booleanisAttributeNamespaceDeclaration(int index)
Return true if attribute at index is namespace declaration such as xmlns='...' or xmlns:prefix='...'
booleanremoveAttributeByName(String uri, String localName)
This method tries to remove attribute identified by namespace uti and local name.
booleanremoveAttributeByRawName(String rawName)
This method tries to remove attribute identified by raw name.
voidremoveAttributes()
remove all atribute
voidresetStartTag()
Clear all Tag state to default values.

Method Detail

addAttribute

public void addAttribute(String namespaceUri, String localName, String rawName, String value)
parameters modeled after SAX2 attribute approach

addAttribute

public void addAttribute(String namespaceUri, String localName, String rawName, String value, boolean isNamespaceDeclaration)
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)

ensureAttributesCapacity

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

getAttributeCount

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

getAttributeLocalName

public 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.

getAttributeNamespaceUri

public 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.

getAttributePrefix

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

getAttributeRawName

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

getAttributeValue

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

getAttributeValueFromName

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

getAttributeValueFromRawName

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

isAttributeNamespaceDeclaration

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

removeAttributeByName

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

Returns: true if attribute was removed or false otherwise.

removeAttributeByRawName

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

Returns: true if attribute was removed or false otherwise.

removeAttributes

public void removeAttributes()
remove all atribute

resetStartTag

public void resetStartTag()
Clear all Tag state to default values.
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