Package org.gjt.xpp
Interface XmlStartTag
- All Superinterfaces:
XmlTag
- All Known Subinterfaces:
XmlNode
,XmlPullNode
This class represents abstract functionality necessary to
to persist XML Pull Parser events.
- Author:
- Aleksander Slominski
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String namespaceUri, String localName, String rawName, String value) parameters modeled after SAX2 attribute approachvoid
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 processingvoid
ensureAttributesCapacity
(int minCapacity) Pre-allocate if necessary tag data structure to hold at least minCapacity attributes .int
Returns the number of attributes on the current elementgetAttributeLocalName
(int index) Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled.getAttributeNamespaceUri
(int index) Returns the namespace URI of the specified attribute number index (starts from 0).getAttributePrefix
(int index) Returns the prefix of the specified attribute Returns null if invalid index or if element has no prefix.getAttributeRawName
(int index) Returns the raw name of the specified attribute Returns null if invalid index.getAttributeValue
(int index) Returns the given attributes value Returns null if invalid index.getAttributeValueFromName
(String namespaceUri, String localName) Returns the given attributes valuegetAttributeValueFromRawName
(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
(String uri, String localName) This method tries to remove attribute identified by namespace uti and local name.boolean
removeAttributeByRawName
(String rawName) This method tries to remove attribute identified by raw name.void
remove all atributevoid
Clear all Tag state to default values.Methods inherited from interface org.gjt.xpp.XmlTag
getLocalName, getNamespaceUri, getPrefix, getRawName, modifyTag, resetTag
-
Method Details
-
resetStartTag
void resetStartTag()Clear all Tag state to default values. -
getAttributeCount
int getAttributeCount()Returns the number of attributes on the current element -
getAttributeNamespaceUri
Returns the namespace URI of the specified attribute number index (starts from 0). (meaningful only if namespaces enabled) Returns null if invalid index. -
getAttributeLocalName
Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled. Returns null if invalid index. -
getAttributePrefix
Returns the prefix of the specified attribute Returns null if invalid index or if element has no prefix. -
getAttributeRawName
Returns the raw name of the specified attribute Returns null if invalid index. -
getAttributeValue
Returns the given attributes value Returns null if invalid index. -
getAttributeValueFromRawName
Returns the given attributes value Returns null if no attribute with rawName. -
getAttributeValueFromName
Returns the given attributes value -
isAttributeNamespaceDeclaration
boolean isAttributeNamespaceDeclaration(int index) Return true if attribute at index is namespace declaration such as xmlns='...' or xmlns:prefix='...' -
addAttribute
void addAttribute(String namespaceUri, String localName, String rawName, String value) throws XmlPullParserException parameters modeled after SAX2 attribute approach- Throws:
XmlPullParserException
-
addAttribute
void addAttribute(String namespaceUri, String localName, String rawName, String value, boolean isNamespaceDeclaration) throws XmlPullParserException Parameter isNamespaceDeclaration if true indicates that attribute is related to namespace management and may be ignored by normal processingNOTE: this class has no support for resolving namespaces and such support may be added later (see XmlNode and namespaces methids)
- Throws:
XmlPullParserException
-
ensureAttributesCapacity
Pre-allocate if necessary tag data structure to hold at least minCapacity attributes .- Throws:
XmlPullParserException
-
removeAttributes
remove all atribute- Throws:
XmlPullParserException
-
removeAttributeByName
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
This method tries to remove attribute identified by raw name.- Returns:
- true if attribute was removed or false otherwise.
- Throws:
XmlPullParserException
-