Top Description Fields Constructors Methods
com.ctc.wstx.evt

pack-priv abstract Class BaseStartElement

extends BaseEventImpl
implements StartElement
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.StartElement, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Known Direct Subclasses
com.ctc.wstx.evt.CompactStartElement, com.ctc.wstx.evt.SimpleStartElement
Imports
java.io.IOException, .Writer, java.util.Iterator, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.*, javax.xml.stream.events.Attribute, .Namespace, .StartElement, org.codehaus.stax2.XMLStreamWriter2, org.codehaus.stax2.ri.evt.BaseEventImpl, com.ctc.wstx.exc.WstxIOException, com.ctc.wstx.util.BaseNsContext, .DataUtil

Shared base class of StartElement implementations Wstx uses.

Field Summary

Modifier and TypeField and Description
protected final QName
protected final BaseNsContext
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
mLocation

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public StartElement
asStartElement()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.asStartElement.

Implements javax.xml.stream.events.XMLEvent.asStartElement.

Returns this event as a start element event, may result in a class cast exception if this event is not a start element.

public boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Declared abstract to force redefinition by sub-classes

public abstract Attribute
getAttributeByName(QName
the qname of the desired attribute
name
)

Redeclares javax.xml.stream.events.StartElement.getAttributeByName.

Returns the attribute referred to by the qname.

public abstract Iterator<Attribute>
getAttributes()

Redeclares javax.xml.stream.events.StartElement.getAttributes.

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

public int
getEventType()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.getEventType.

Implements javax.xml.stream.events.XMLEvent.getEventType.

Returns an integer code for this event.

public final QName
getName()

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

Get the name of this event

public NamespaceContext
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
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 int
hashCode()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Declared abstract to force redefinition by sub-classes

public boolean
isStartElement()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.isStartElement.

Implements javax.xml.stream.events.XMLEvent.isStartElement.

A utility function to check if this event is a StartElement.

protected abstract void
protected abstract void
public void
writeAsEncodedUnicode(Writer
The writer that will output the data
w
)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeAsEncodedUnicode.

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

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.

public void
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
addHashasCharactersasEndElementgetLocationgetSchemaTypeisAttributeisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentiteratedEqualsstringsWithNullsEqualthrowFromIOEtoString

Field Detail

mNameback to summary
protected final QName mName
mNsCtxtback to summary
protected final BaseNsContext mNsCtxt

Constructor Detail

BaseStartElementback to summary
protected BaseStartElement(Location loc, QName name, BaseNsContext nsCtxt)

Method Detail

asStartElementback to summary
public StartElement asStartElement()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.asStartElement.

Implements javax.xml.stream.events.XMLEvent.asStartElement.

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

Returns this event as a start element event, may result in a class cast exception if this event is not a start element.

Returns:StartElement

a StartElement event

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Doc from org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Declared abstract to force redefinition by sub-classes

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAttributeByNameback to summary
public abstract Attribute getAttributeByName(QName name)

Redeclares 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

Annotations
@Override
getAttributesback to summary
public abstract Iterator<Attribute> getAttributes()

Redeclares 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<Attribute>

a readonly Iterator over Attribute interfaces, or an empty iterator

Annotations
@Override
getEventTypeback to summary
public int getEventType()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.getEventType.

Implements javax.xml.stream.events.XMLEvent.getEventType.

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

Returns an integer code for this event.

Returns:int

the event type

Annotations
@Override
getNameback to summary
public final QName getName()

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

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

Get the name of this event

Returns:QName

the qualified name of this event

Annotations
@Override
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

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.

Returns:Iterator<Namespace>

a readonly Iterator over Namespace interfaces, or an empty iterator

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

Parameters
prefix:String

the prefix to lookup

Returns:String

the uri bound to the prefix or null

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Doc from org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Declared abstract to force redefinition by sub-classes

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
isStartElementback to summary
public boolean isStartElement()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.isStartElement.

Implements javax.xml.stream.events.XMLEvent.isStartElement.

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

A utility function to check if this event is a StartElement.

Returns:boolean

true if the event is StartElement, false otherwise

Annotations
@Override
outputNsAndAttrback to summary
protected abstract void outputNsAndAttr(Writer w) throws IOException
outputNsAndAttrback to summary
protected abstract void outputNsAndAttr(XMLStreamWriter w) throws XMLStreamException
writeAsEncodedUnicodeback to summary
public void writeAsEncodedUnicode(Writer w) throws XMLStreamException

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeAsEncodedUnicode.

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
w:Writer

The writer that will output the data

Annotations
@Override
Exceptions
XMLStreamException:
if there is a fatal error writing the event
writeUsingback to summary
public void writeUsing(XMLStreamWriter2 w) throws XMLStreamException

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeUsing.

Implements org.codehaus.stax2.evt.XMLEvent2.writeUsing.

Annotations
@Override