Top Description Fields Constructors Methods
org.codehaus.stax2.ri.evt

public Class NamespaceEventImpl

extends AttributeEventImpl
implements Namespace
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.Namespace, javax.xml.stream.events.Attribute, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
javax.xml.XMLConstants, javax.xml.stream.*, javax.xml.stream.events.Namespace

Implementation of Namespace. Only returned via accessors in actual "first class" event objects (start element, end element); never directly via event reader.

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final String
Inherited from org.codehaus.stax2.ri.evt.AttributeEventImpl:
mNamemValuemWasSpecified

Constructor Summary

AccessConstructor and Description
protected
NamespaceEventImpl(Location loc, String nsURI)

Constructor for default namespace declaration.

protected
NamespaceEventImpl(Location loc, String nsPrefix, String nsURI)

Constructor for non-default namespace declaration.

Method Summary

Modifier and TypeMethod and Description
public static NamespaceEventImpl
public static NamespaceEventImpl
constructNamespace(Location loc, String nsPrefix, String nsURI)

public int
public String
getNamespaceURI()

Implements javax.xml.stream.events.Namespace.getNamespaceURI.

Gets the uri bound to the prefix of this namespace
public String
getPrefix()

Implements javax.xml.stream.events.Namespace.getPrefix.

Gets the prefix, returns "" if this is a default namespace declaration.
public boolean
isDefaultNamespaceDeclaration()

Implements javax.xml.stream.events.Namespace.isDefaultNamespaceDeclaration.

returns true if this attribute declares the default namespace
public boolean
isNamespace()

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

Implements javax.xml.stream.events.XMLEvent.isNamespace.

A utility function to check if this event is a Namespace.
Inherited from org.codehaus.stax2.ri.evt.AttributeEventImpl:
equalsgetDTDTypegetNamegetValuehashCodeisAttributeisSpecifiedwriteAsEncodedUnicodewriteEscapedAttrValuewriteUsing

Field Detail

mPrefixback to summary
pack-priv final String mPrefix
mURIback to summary
pack-priv final String mURI

Constructor Detail

NamespaceEventImplback to summary
protected NamespaceEventImpl(Location loc, String nsURI)

Constructor for default namespace declaration. Such declarations don't have namespace prefix/URI, although semantically it would belong to XML namespace URI...

NamespaceEventImplback to summary
protected NamespaceEventImpl(Location loc, String nsPrefix, String nsURI)

Constructor for non-default namespace declaration. Such declarations belong to "XML namespace" namespace.

Method Detail

constructDefaultNamespaceback to summary
public static NamespaceEventImpl constructDefaultNamespace(Location loc, String nsURI)
constructNamespaceback to summary
public static NamespaceEventImpl constructNamespace(Location loc, String nsPrefix, String nsURI)
getEventTypeback to summary
public int getEventType()

Overrides org.codehaus.stax2.ri.evt.AttributeEventImpl.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
getNamespaceURIback to summary
public String getNamespaceURI()

Implements javax.xml.stream.events.Namespace.getNamespaceURI.

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

Gets the uri bound to the prefix of this namespace

Returns:String

the NamespaceURI

Annotations
@Override
getPrefixback to summary
public String getPrefix()

Implements javax.xml.stream.events.Namespace.getPrefix.

Doc from javax.xml.stream.events.Namespace.getPrefix.

Gets the prefix, returns "" if this is a default namespace declaration.

Returns:String

the prefix

Annotations
@Override
isDefaultNamespaceDeclarationback to summary
public boolean isDefaultNamespaceDeclaration()

Implements javax.xml.stream.events.Namespace.isDefaultNamespaceDeclaration.

Doc from javax.xml.stream.events.Namespace.isDefaultNamespaceDeclaration.

returns true if this attribute declares the default namespace

Returns:boolean

true if this is default namespace, false otherwise

Annotations
@Override
isNamespaceback to summary
public boolean isNamespace()

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

Implements javax.xml.stream.events.XMLEvent.isNamespace.

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

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

Returns:boolean

true if the event is Namespace, false otherwise

Annotations
@Override