Top Description Fields Constructors Methods
org.dom4j.xpp

public Class ProxyXmlStartTag

extends Object
implements XmlStartTag
Class Inheritance
All Implemented Interfaces
org.gjt.xpp.XmlStartTag, org.gjt.xpp.XmlTag
Imports
java.util.ArrayList, .Iterator, org.dom4j.Attribute, .DocumentFactory, .Element, .QName, org.dom4j.tree.AbstractElement, org.gjt.xpp.XmlPullParserException, .XmlStartTag

ProxyXmlStartTag implements the XPP XmlSmartTag interface while creating a dom4j Element underneath.

Author
James Strachan
Version
$Revision: 1.8 $

Field Summary

Modifier and TypeField and Description
private Element
element

The element being constructed

private DocumentFactory
factory

The factory used to create new elements

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(String
DOCUMENT ME!
namespaceURI
,
String
DOCUMENT ME!
localName
,
String
DOCUMENT ME!
rawName
,
String
DOCUMENT ME!
value
)

Implements org.gjt.xpp.XmlStartTag.addAttribute.

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

Implements org.gjt.xpp.XmlStartTag.addAttribute.

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)

public void
ensureAttributesCapacity(int minCapacity)

Implements org.gjt.xpp.XmlStartTag.ensureAttributesCapacity.

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

Implements org.gjt.xpp.XmlStartTag.getAttributeCount.

Returns the number of attributes on the current element
public String
getAttributeLocalName(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributeLocalName.

Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled.
public String
getAttributeNamespaceUri(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributeNamespaceUri.

Returns the namespace URI of the specified attribute number index (starts from 0).
public String
getAttributePrefix(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributePrefix.

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

Implements org.gjt.xpp.XmlStartTag.getAttributeRawName.

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

Implements org.gjt.xpp.XmlStartTag.getAttributeValue.

Returns the given attributes value Returns null if invalid index.
public String
getAttributeValueFromName(String namespaceURI, String localName)

Implements org.gjt.xpp.XmlStartTag.getAttributeValueFromName.

Returns the given attributes value
public String
getAttributeValueFromRawName(String rawName)

Implements org.gjt.xpp.XmlStartTag.getAttributeValueFromRawName.

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

Implements org.gjt.xpp.XmlTag.getLocalName.

Returns the local name of the current element
public String
getNamespaceUri()

Implements org.gjt.xpp.XmlTag.getNamespaceUri.

Returns the namespace URI of the current element Returns null if not applicable
public String
getPrefix()

Implements org.gjt.xpp.XmlTag.getPrefix.

Returns the prefix of the current element or null if elemet has no prefix.
public String
getRawName()

Implements org.gjt.xpp.XmlTag.getRawName.

Returns the raw name (prefix + ':' + localName) of the current element
public boolean
isAttributeNamespaceDeclaration(int index)

Implements org.gjt.xpp.XmlStartTag.isAttributeNamespaceDeclaration.

Return true if attribute at index is namespace declaration such as xmlns='...' or xmlns:prefix='...'
public void
modifyTag(String
maybe null then default "" namespace is used
namespaceURI
,
String
may be null then rawName is used
lName
,
String
actual attribute name MUST be not null if it is null exception MUST be thrown
rawName
)

Implements org.gjt.xpp.XmlTag.modifyTag.

Modify tag to have namespace URI, localName and rawName.
public boolean
removeAttributeByName(String s, String s1)

Implements org.gjt.xpp.XmlStartTag.removeAttributeByName.

This method tries to remove attribute identified by namespace uti and local name.
public boolean
removeAttributeByRawName(String s)

Implements org.gjt.xpp.XmlStartTag.removeAttributeByRawName.

This method tries to remove attribute identified by raw name.
public void
public void
resetStartTag()

Implements org.gjt.xpp.XmlStartTag.resetStartTag.

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

Implements org.gjt.xpp.XmlTag.resetTag.

Clear all Tag state to default values.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

elementback to summary
private Element element

The element being constructed

factoryback to summary
private DocumentFactory factory

The factory used to create new elements

Constructor Detail

ProxyXmlStartTagback to summary
public ProxyXmlStartTag()
ProxyXmlStartTagback to summary
public ProxyXmlStartTag(Element element)

Method Detail

addAttributeback to summary
public void addAttribute(String namespaceURI, String localName, String rawName, String value) throws XmlPullParserException

Implements org.gjt.xpp.XmlStartTag.addAttribute.

parameters modeled after SAX2 attribute approach

Parameters
namespaceURI:String

DOCUMENT ME!

localName:String

DOCUMENT ME!

rawName:String

DOCUMENT ME!

value:String

DOCUMENT ME!

Exceptions
XmlPullParserException:
DOCUMENT ME!
addAttributeback to summary
public void addAttribute(String namespaceURI, String localName, String rawName, String value, boolean isNamespaceDeclaration) throws XmlPullParserException

Implements org.gjt.xpp.XmlStartTag.addAttribute.

Doc from org.gjt.xpp.XmlStartTag.addAttribute.

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)

ensureAttributesCapacityback to summary
public void ensureAttributesCapacity(int minCapacity) throws XmlPullParserException

Implements org.gjt.xpp.XmlStartTag.ensureAttributesCapacity.

Doc from org.gjt.xpp.XmlStartTag.ensureAttributesCapacity.

Pre-allocate if necessary tag data structure to hold at least minCapacity attributes .

getAttributeCountback to summary
public int getAttributeCount()

Implements org.gjt.xpp.XmlStartTag.getAttributeCount.

Doc from org.gjt.xpp.XmlStartTag.getAttributeCount.

Returns the number of attributes on the current element

getAttributeLocalNameback to summary
public String getAttributeLocalName(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributeLocalName.

Doc from org.gjt.xpp.XmlStartTag.getAttributeLocalName.

Returns the localname of the specified attribute if namespaces enabled or just attribute name if namespaces disabled. Returns null if invalid index.

getAttributeNamespaceUriback to summary
public String getAttributeNamespaceUri(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributeNamespaceUri.

Doc from org.gjt.xpp.XmlStartTag.getAttributeNamespaceUri.

Returns the namespace URI of the specified attribute number index (starts from 0). (meaningful only if namespaces enabled) Returns null if invalid index.

getAttributePrefixback to summary
public String getAttributePrefix(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributePrefix.

Doc from org.gjt.xpp.XmlStartTag.getAttributePrefix.

Returns the prefix of the specified attribute Returns null if invalid index or if element has no prefix.

getAttributeRawNameback to summary
public String getAttributeRawName(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributeRawName.

Doc from org.gjt.xpp.XmlStartTag.getAttributeRawName.

Returns the raw name of the specified attribute Returns null if invalid index.

getAttributeValueback to summary
public String getAttributeValue(int index)

Implements org.gjt.xpp.XmlStartTag.getAttributeValue.

Doc from org.gjt.xpp.XmlStartTag.getAttributeValue.

Returns the given attributes value Returns null if invalid index.

getAttributeValueFromNameback to summary
public String getAttributeValueFromName(String namespaceURI, String localName)

Implements org.gjt.xpp.XmlStartTag.getAttributeValueFromName.

Doc from org.gjt.xpp.XmlStartTag.getAttributeValueFromName.

Returns the given attributes value

getAttributeValueFromRawNameback to summary
public String getAttributeValueFromRawName(String rawName)

Implements org.gjt.xpp.XmlStartTag.getAttributeValueFromRawName.

Doc from org.gjt.xpp.XmlStartTag.getAttributeValueFromRawName.

Returns the given attributes value Returns null if no attribute with rawName.

getDocumentFactoryback to summary
public DocumentFactory getDocumentFactory()
getElementback to summary
public Element getElement()
getLocalNameback to summary
public String getLocalName()

Implements org.gjt.xpp.XmlTag.getLocalName.

Doc from org.gjt.xpp.XmlTag.getLocalName.

Returns the local name of the current element

getNamespaceUriback to summary
public String getNamespaceUri()

Implements org.gjt.xpp.XmlTag.getNamespaceUri.

Doc from org.gjt.xpp.XmlTag.getNamespaceUri.

Returns the namespace URI of the current element Returns null if not applicable

getPrefixback to summary
public String getPrefix()

Implements org.gjt.xpp.XmlTag.getPrefix.

Doc from org.gjt.xpp.XmlTag.getPrefix.

Returns the prefix of the current element or null if elemet has no prefix.

getRawNameback to summary
public String getRawName()

Implements org.gjt.xpp.XmlTag.getRawName.

Doc from org.gjt.xpp.XmlTag.getRawName.

Returns the raw name (prefix + ':' + localName) of the current element

isAttributeNamespaceDeclarationback to summary
public boolean isAttributeNamespaceDeclaration(int index)

Implements org.gjt.xpp.XmlStartTag.isAttributeNamespaceDeclaration.

Doc from org.gjt.xpp.XmlStartTag.isAttributeNamespaceDeclaration.

Return true if attribute at index is namespace declaration such as xmlns='...' or xmlns:prefix='...'

modifyTagback to summary
public void modifyTag(String namespaceURI, String lName, String rawName)

Implements org.gjt.xpp.XmlTag.modifyTag.

Doc from org.gjt.xpp.XmlTag.modifyTag.

Modify tag to have namespace URI, localName and rawName.

Note

setting modeled after SAX2 startTag

Parameters
namespaceURI:String

maybe null then default "" namespace is used

lName:String

may be null then rawName is used

rawName:String

actual attribute name MUST be not null if it is null exception MUST be thrown

removeAttributeByNameback to summary
public boolean removeAttributeByName(String s, String s1) throws XmlPullParserException

Implements org.gjt.xpp.XmlStartTag.removeAttributeByName.

Doc from org.gjt.xpp.XmlStartTag.removeAttributeByName.

This method tries to remove attribute identified by namespace uti and local name.

Returns:boolean

true if attribute was removed or false otherwise.

Annotations
@Override
removeAttributeByRawNameback to summary
public boolean removeAttributeByRawName(String s) throws XmlPullParserException

Implements org.gjt.xpp.XmlStartTag.removeAttributeByRawName.

Doc from org.gjt.xpp.XmlStartTag.removeAttributeByRawName.

This method tries to remove attribute identified by raw name.

Returns:boolean

true if attribute was removed or false otherwise.

Annotations
@Override
removeAttributesback to summary
public void removeAttributes() throws XmlPullParserException

Implements org.gjt.xpp.XmlStartTag.removeAttributes.

remove all atribute

Annotations
@Override
Exceptions
XmlPullParserException:
DOCUMENT ME!
resetStartTagback to summary
public void resetStartTag()

Implements org.gjt.xpp.XmlStartTag.resetStartTag.

Doc from org.gjt.xpp.XmlStartTag.resetStartTag.

Clear all Tag state to default values.

resetTagback to summary
public void resetTag()

Implements org.gjt.xpp.XmlTag.resetTag.

Doc from org.gjt.xpp.XmlTag.resetTag.

Clear all Tag state to default values.

setDocumentFactoryback to summary
public void setDocumentFactory(DocumentFactory documentFactory)