Top Fields Constructors Methods
org.apache.xerces.stax.events

public final Class StartElementImpl

extends ElementImpl
implements StartElement
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.StartElement, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .Writer, java.util.Collections, .Comparator, .Iterator, .Map, .TreeMap, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.Location, .XMLStreamException, javax.xml.stream.events.Attribute, .Namespace, .StartElement, org.apache.xerces.stax.DefaultNamespaceContext

Author
Lucian Holland
Version
$Id: StartElementImpl.java 730796 2009-01-02 17:36:23Z mrglavas $

Field Summary

Modifier and TypeField and Description
private final Map<K, V>
private final NamespaceContext
private static final Comparator<T>

Constructor Summary

AccessConstructor and Description
public
StartElementImpl(final QName name, final Iterator<E> attributes, final Iterator<E> namespaces, final NamespaceContext namespaceContext, final Location location)

Method Summary

Modifier and TypeMethod and Description
public Attribute
getAttributeByName(final QName
the qname of the desired attribute
name
)

Implements javax.xml.stream.events.StartElement.getAttributeByName.

Returns the attribute referred to by the qname.
public Iterator<E>
getAttributes()

Implements javax.xml.stream.events.StartElement.getAttributes.

Returns an Iterator of non-namespace attributes declared on this START_ELEMENT.
public NamespaceContext
getNamespaceContext()

Implements javax.xml.stream.events.StartElement.getNamespaceContext.

Gets a read-only namespace context.
public String
getNamespaceURI(final String
the prefix to lookup
prefix
)

Implements javax.xml.stream.events.StartElement.getNamespaceURI.

Gets the value that the prefix is bound to in the context of this element.
public void
writeAsEncodedUnicode(Writer
The writer that will output the data
writer
)

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
Inherited from org.apache.xerces.stax.events.ElementImpl:
createImmutableIteratorgetNamegetNamespaces

Field Detail

fAttributesback to summary
private final Map<K, V> fAttributes
fNamespaceContextback to summary
private final NamespaceContext fNamespaceContext
QNAME_COMPARATORback to summary
private static final Comparator<T> QNAME_COMPARATOR

Constructor Detail

StartElementImplback to summary
public StartElementImpl(final QName name, final Iterator<E> attributes, final Iterator<E> namespaces, final NamespaceContext namespaceContext, final Location location)

Method Detail

getAttributeByNameback to summary
public Attribute getAttributeByName(final QName name)

Implements javax.xml.stream.events.StartElement.getAttributeByName.

Doc from javax.xml.stream.events.StartElement.getAttributeByName.

Returns the attribute referred to by the qname.

Parameters
name:QName

the qname of the desired attribute

Returns:Attribute

the attribute corresponding to the name value or null

See Also
javax.xml.stream.events.StartElement#getAttributeByName(javax.xml.namespace.QName)
getAttributesback to summary
public Iterator<E> getAttributes()

Implements javax.xml.stream.events.StartElement.getAttributes.

Doc from javax.xml.stream.events.StartElement.getAttributes.

Returns an Iterator of non-namespace attributes declared on this START_ELEMENT. Returns an empty iterator if there are no attributes. The iterator must contain only implementations of the Attribute interface. Attributes are fundamentally unordered and may be reported in any order.

Returns:Iterator<E>

a readonly Iterator over Attribute interfaces, or an empty iterator

See Also
javax.xml.stream.events.StartElement#getAttributes()
getNamespaceContextback to summary
public NamespaceContext getNamespaceContext()

Implements javax.xml.stream.events.StartElement.getNamespaceContext.

Doc from javax.xml.stream.events.StartElement.getNamespaceContext.

Gets a read-only namespace context. If no context is available this method will return an empty namespace context. The NamespaceContext contains information about all namespaces in scope for this StartElement.

Returns:NamespaceContext

the current namespace context

See Also
javax.xml.stream.events.StartElement#getNamespaceContext()
getNamespaceURIback to summary
public String getNamespaceURI(final String prefix)

Implements javax.xml.stream.events.StartElement.getNamespaceURI.

Doc from javax.xml.stream.events.StartElement.getNamespaceURI.

Gets the value that the prefix is bound to in the context of this element. Returns null if the prefix is not bound in this context

Parameters
prefix:String

the prefix to lookup

Returns:String

the uri bound to the prefix or null

See Also
javax.xml.stream.events.StartElement#getNamespaceURI(java.lang.String)
writeAsEncodedUnicodeback to summary
public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

Doc from javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.

Parameters
writer:Writer

The writer that will output the data

Exceptions
XMLStreamException:
if there is a fatal error writing the event