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

public Class StartDocumentEventImpl

extends BaseEventImpl
implements StartDocument
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.StartDocument, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .Writer, javax.xml.stream.*, javax.xml.stream.events.StartDocument, org.codehaus.stax2.XMLStreamWriter2

Field Summary

Modifier and TypeField and Description
private final String
private final boolean
private final boolean
private final boolean
private final String
private final String
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
mLocation

Constructor Summary

AccessConstructor and Description
public
public
StartDocumentEventImpl(Location loc)

Method called by event factory, when constructing start document event.

public
public
StartDocumentEventImpl(Location loc, String encoding, String version)

public
StartDocumentEventImpl(Location loc, String encoding, String version, boolean standaloneSet, boolean isStandalone)

Method Summary

Modifier and TypeMethod and Description
public boolean
encodingSet()

Implements javax.xml.stream.events.StartDocument.encodingSet.

Returns true if CharacterEncodingScheme is set in the encoding declaration of the document
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 String
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 String
getSystemId()

Implements javax.xml.stream.events.StartDocument.getSystemId.

Returns the system ID of the XML data
public String
getVersion()

Implements javax.xml.stream.events.StartDocument.getVersion.

Returns the version of XML of this XML stream
public int
hashCode()

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

Declared abstract to force redefinition by sub-classes
public boolean
isStandalone()

Implements javax.xml.stream.events.StartDocument.isStandalone.

Returns if this XML is standalone
public boolean
isStartDocument()

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

Implements javax.xml.stream.events.XMLEvent.isStartDocument.

A utility function to check if this event is a StartDocument.
public boolean
standaloneSet()

Implements javax.xml.stream.events.StartDocument.standaloneSet.

Returns true if the standalone attribute is set in the encoding declaration of the document.
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:
addHashasCharactersasEndElementasStartElementgetLocationgetSchemaTypeisAttributeisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartElementiteratedEqualsstringsWithNullsEqualthrowFromIOEtoString

Field Detail

mEncodingSchemeback to summary
private final String mEncodingScheme
mEncodingSetback to summary
private final boolean mEncodingSet
mIsStandaloneback to summary
private final boolean mIsStandalone
mStandaloneSetback to summary
private final boolean mStandaloneSet
mSystemIdback to summary
private final String mSystemId
mVersionback to summary
private final String mVersion

Constructor Detail

StartDocumentEventImplback to summary
public StartDocumentEventImpl(Location loc, XMLStreamReader r)
StartDocumentEventImplback to summary
public StartDocumentEventImpl(Location loc)

Method called by event factory, when constructing start document event.

StartDocumentEventImplback to summary
public StartDocumentEventImpl(Location loc, String encoding)
StartDocumentEventImplback to summary
public StartDocumentEventImpl(Location loc, String encoding, String version)
StartDocumentEventImplback to summary
public StartDocumentEventImpl(Location loc, String encoding, String version, boolean standaloneSet, boolean isStandalone)

Method Detail

encodingSetback to summary
public boolean encodingSet()

Implements javax.xml.stream.events.StartDocument.encodingSet.

Doc from javax.xml.stream.events.StartDocument.encodingSet.

Returns true if CharacterEncodingScheme is set in the encoding declaration of the document

Returns:boolean

true if CharacterEncodingScheme is set, false otherwise

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
getCharacterEncodingSchemeback to summary
public String getCharacterEncodingScheme()

Implements javax.xml.stream.events.StartDocument.getCharacterEncodingScheme.

Doc from javax.xml.stream.events.StartDocument.getCharacterEncodingScheme.

Returns the encoding style of the XML data

Returns:String

the character encoding, defaults to "UTF-8"

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
getSystemIdback to summary
public String getSystemId()

Implements javax.xml.stream.events.StartDocument.getSystemId.

Doc from javax.xml.stream.events.StartDocument.getSystemId.

Returns the system ID of the XML data

Returns:String

the system ID, defaults to ""

Annotations
@Override
getVersionback to summary
public String getVersion()

Implements javax.xml.stream.events.StartDocument.getVersion.

Doc from javax.xml.stream.events.StartDocument.getVersion.

Returns the version of XML of this XML stream

Returns:String

the version of XML, defaults to "1.0"

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
isStandaloneback to summary
public boolean isStandalone()

Implements javax.xml.stream.events.StartDocument.isStandalone.

Doc from javax.xml.stream.events.StartDocument.isStandalone.

Returns if this XML is standalone

Returns:boolean

the standalone state of XML, defaults to "no"

Annotations
@Override
isStartDocumentback to summary
public boolean isStartDocument()

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

Implements javax.xml.stream.events.XMLEvent.isStartDocument.

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

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

Returns:boolean

true if the event is StartDocument, false otherwise

Annotations
@Override
standaloneSetback to summary
public boolean standaloneSet()

Implements javax.xml.stream.events.StartDocument.standaloneSet.

Doc from javax.xml.stream.events.StartDocument.standaloneSet.

Returns true if the standalone attribute is set in the encoding declaration of the document.

Returns:boolean

true if the standalone attribute is set, false otherwise

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