APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.xml.internal.stream.events

public Class StartElementEvent

extends DummyEvent
implements StartElement
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.StartElement, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
com.sun.xml.internal.stream.util.ReadOnlyIterator, java.util.ArrayList, .Collection, .HashMap, .Iterator, .List, .Map, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.XMLStreamConstants, javax.xml.stream.events.Attribute, .Namespace, .StartElement

Implementation of StartElementEvent.
Authors
Neeraj Bajaj Sun Microsystems,Inc., K.Venugopal Sun Microsystems,Inc.

Field Summary

Modifier and TypeField and Description
private Map<QName, Attribute>
private NamespaceContext
private List<Namespace>
private QName
Inherited from com.sun.xml.internal.stream.events.DummyEvent:
fLocation

Constructor Summary

AccessConstructor and Description
public
StartElementEvent(String prefix, String uri, String localpart)

public
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv final void
addAttributes(Iterator<? extends Attribute> attrs)

pack-priv void
pack-priv final void
public Attribute
getAttributeByName(QName qname)

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

Returns the attribute referred to by the qname.

public Iterator<Attribute>
getAttributes()

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

Returns an Iterator of non-namespace attributes declared on this START_ELEMENT.

public QName
getName()

Implements javax.xml.stream.events.StartElement.getName.

Get the name of this event

public String
public NamespaceContext

Returns:

the current namespace context
getNamespaceContext
()

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

Gets a read-only namespace context.

public Iterator<Namespace>
getNamespaces()

Implements javax.xml.stream.events.StartElement.getNamespaces.

Returns an Iterator of namespaces declared on this element.

public String
getNamespaceURI(String prefix)

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

Gets the value that the prefix is bound to in the context of this element.

protected final void
init()

public String

Returns:

String Event returned as string.
nameAsString
()

Return this event as String

public void
setName(QName qname)

public void
public String

Returns:

String representation of this StartElement formatted as XML.
toString
()

Overrides java.lang.Object.toString.

Return a String representation of this StartElement formatted as XML.

protected void
writeAsEncodedUnicodeEx(Writer writer)

Implements abstract com.sun.xml.internal.stream.events.DummyEvent.writeAsEncodedUnicodeEx.

Helper method in order to expose IOException.

Inherited from com.sun.xml.internal.stream.events.DummyEvent:
asCharactersasEndElementasStartElementcharEncodegetEventTypegetLocationgetSchemaTypeisAttributeisCharacterDataisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentisStartElementsetEventTypesetLocationwriteAsEncodedUnicode

Field Detail

fAttributesback to summary
private Map<QName, Attribute> fAttributes
fNamespaceContextback to summary
private NamespaceContext fNamespaceContext
fNamespacesback to summary
private List<Namespace> fNamespaces
fQNameback to summary
private QName fQName

Constructor Detail

StartElementEventback to summary
public StartElementEvent(String prefix, String uri, String localpart)
StartElementEventback to summary
public StartElementEvent(QName qname)
StartElementEventback to summary
public StartElementEvent(StartElement startelement)

Method Detail

addAttributeback to summary
pack-priv void addAttribute(Attribute attr)
addAttributesback to summary
pack-priv final void addAttributes(Iterator<? extends Attribute> attrs)
addNamespaceAttributeback to summary
pack-priv void addNamespaceAttribute(Namespace attr)
addNamespaceAttributesback to summary
pack-priv final void addNamespaceAttributes(Iterator<? extends Namespace> attrs)
getAttributeByNameback to summary
public Attribute getAttributeByName(QName qname)

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

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

Returns the attribute referred to by the qname.

Annotations
@Override
getAttributesback to summary
public Iterator<Attribute> 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.

Annotations
@Override
getNameback to summary
public QName getName()

Implements javax.xml.stream.events.StartElement.getName.

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

Get the name of this event

Annotations
@Override
getNamespaceback to summary
public String getNamespace()
getNamespaceContextback to summary
public NamespaceContext getNamespaceContext()

Implements 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

Annotations
@Override
getNamespacesback to summary
public Iterator<Namespace> getNamespaces()

Implements javax.xml.stream.events.StartElement.getNamespaces.

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

Returns an Iterator of namespaces declared on this element. This Iterator does not contain previously declared namespaces unless they appear on the current START_ELEMENT. Therefore this list may contain redeclared namespaces and duplicate namespace declarations. Use the getNamespaceContext() method to get the current context of namespace declarations.

The iterator must contain only implementations of the Namespace interface.

A Namespace is an Attribute. One can iterate over a list of namespaces as a list of attributes. However this method returns only the list of namespaces declared on this START_ELEMENT and does not include the attributes declared on this START_ELEMENT. Returns an empty iterator if there are no namespaces.

Annotations
@Override
getNamespaceURIback to summary
public String getNamespaceURI(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

Annotations
@Override
initback to summary
protected final void init()
nameAsStringback to summary
public String nameAsString()

Return this event as String

Returns:String

String Event returned as string.

setNameback to summary
public void setName(QName qname)
setNamespaceContextback to summary
public void setNamespaceContext(NamespaceContext nc)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a String representation of this StartElement formatted as XML.

Returns:String

String representation of this StartElement formatted as XML.

Annotations
@Override
writeAsEncodedUnicodeExback to summary
protected void writeAsEncodedUnicodeEx(Writer writer) throws IOException

Implements abstract com.sun.xml.internal.stream.events.DummyEvent.writeAsEncodedUnicodeEx.

Doc from com.sun.xml.internal.stream.events.DummyEvent.writeAsEncodedUnicodeEx.

Helper method in order to expose IOException.

Annotations
@Override
Exceptions
IOException:
if there is an IO error