Top Description Inners Fields Constructors Methods
com.sun.xml.internal.stream.events

public abstract Class DummyEvent

extends Object
implements XMLEvent
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Known Direct Subclasses
com.sun.xml.internal.stream.events.EndDocumentEvent, com.sun.xml.internal.stream.events.EndElementEvent, com.sun.xml.internal.stream.events.EntityDeclarationImpl, com.sun.xml.internal.stream.events.EntityReferenceEvent, com.sun.xml.internal.stream.events.NamedEvent, com.sun.xml.internal.stream.events.NotationDeclarationImpl, com.sun.xml.internal.stream.events.ProcessingInstructionEvent, com.sun.xml.internal.stream.events.StartDocumentEvent, com.sun.xml.internal.stream.events.StartElementEvent, com.sun.xml.internal.stream.events.AttributeImpl, com.sun.xml.internal.stream.events.CharacterEvent, com.sun.xml.internal.stream.events.CommentEvent, com.sun.xml.internal.stream.events.DTDEvent
Imports
java.io.IOException, .Writer, javax.xml.stream.events.XMLEvent, .Characters, .EndElement, .StartElement, javax.xml.namespace.QName, javax.xml.stream.Location, .XMLStreamException

DummyEvent is an abstract class. It provides functionality for most of the function of XMLEvent.
Authors
Neeraj Bajaj Sun Microsystems,Inc., K.Venugopal Sun Microsystems,Inc.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private int
protected Location
private static DummyEvent.DummyLocation

Constructor Summary

AccessConstructor and Description
public
public
DummyEvent(int i)

Method Summary

Modifier and TypeMethod and Description
public Characters
asCharacters()

Implements javax.xml.stream.events.XMLEvent.asCharacters.

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

public EndElement
asEndElement()

Implements javax.xml.stream.events.XMLEvent.asEndElement.

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

public StartElement
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.

protected void
charEncode(Writer writer, String data)

Helper method to escape < > & for characters event and quotes, lt and amps for Entity

public int
getEventType()

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

Returns an integer code for this event.

public Location
getLocation()

Implements javax.xml.stream.events.XMLEvent.getLocation.

Return the location of this event.

public QName
getSchemaType()

Implements javax.xml.stream.events.XMLEvent.getSchemaType.

This method is provided for implementations to provide optional type information about the associated event.

public boolean
isAttribute()

Implements javax.xml.stream.events.XMLEvent.isAttribute.

A utility function to check if this event is an Attribute.

public boolean
public boolean
isCharacters()

Implements javax.xml.stream.events.XMLEvent.isCharacters.

A utility function to check if this event is Characters.

public boolean
isEndDocument()

Implements javax.xml.stream.events.XMLEvent.isEndDocument.

A utility function to check if this event is an EndDocument.

public boolean
isEndElement()

Implements javax.xml.stream.events.XMLEvent.isEndElement.

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

public boolean
isEntityReference()

Implements javax.xml.stream.events.XMLEvent.isEntityReference.

A utility function to check if this event is an EntityReference.

public boolean
isNamespace()

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

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

public boolean
isProcessingInstruction()

Implements javax.xml.stream.events.XMLEvent.isProcessingInstruction.

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

public boolean
isStartDocument()

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

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

public boolean
isStartElement()

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

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

protected void
setEventType(int eventType)

pack-priv void
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.

protected abstract void
writeAsEncodedUnicodeEx(Writer
The writer that will output the data
writer
)

Helper method in order to expose IOException.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fEventTypeback to summary
private int fEventType
fLocationback to summary
protected Location fLocation
nowhereback to summary
private static DummyEvent.DummyLocation nowhere

Constructor Detail

DummyEventback to summary
public DummyEvent()
DummyEventback to summary
public DummyEvent(int i)

Method Detail

asCharactersback to summary
public Characters asCharacters()

Implements javax.xml.stream.events.XMLEvent.asCharacters.

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

Returns:Characters

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

a Characters event

asEndElementback to summary
public EndElement asEndElement()

Implements javax.xml.stream.events.XMLEvent.asEndElement.

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

Returns:EndElement

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

a EndElement event

asStartElementback to summary
public StartElement 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.

Returns:StartElement

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

a StartElement event

charEncodeback to summary
protected void charEncode(Writer writer, String data) throws IOException

Helper method to escape < > & for characters event and quotes, lt and amps for Entity

getEventTypeback to summary
public int 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

getLocationback to summary
public Location getLocation()

Implements javax.xml.stream.events.XMLEvent.getLocation.

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

Return the location of this event. The Location returned from this method is non-volatile and will retain its information.

Returns:Location

the location of the event

getSchemaTypeback to summary
public QName getSchemaType()

Implements javax.xml.stream.events.XMLEvent.getSchemaType.

This method is provided for implementations to provide optional type information about the associated event. It is optional and will return null if no information is available.

Returns:QName

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

the type of the event, null if not available

isAttributeback to summary
public boolean isAttribute()

Implements javax.xml.stream.events.XMLEvent.isAttribute.

A utility function to check if this event is an Attribute.

Returns:boolean

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

true if the event is Attribute, false otherwise

See Also
Attribute
isCharacterDataback to summary
public boolean isCharacterData()
isCharactersback to summary
public boolean isCharacters()

Implements javax.xml.stream.events.XMLEvent.isCharacters.

A utility function to check if this event is Characters.

Returns:boolean

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

true if the event is Characters, false otherwise

See Also
Characters
isEndDocumentback to summary
public boolean isEndDocument()

Implements javax.xml.stream.events.XMLEvent.isEndDocument.

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

A utility function to check if this event is an EndDocument.

Returns:boolean

true if the event is EndDocument, false otherwise

isEndElementback to summary
public boolean isEndElement()

Implements javax.xml.stream.events.XMLEvent.isEndElement.

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

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

Returns:boolean

true if the event is EndElement, false otherwise

isEntityReferenceback to summary
public boolean isEntityReference()

Implements javax.xml.stream.events.XMLEvent.isEntityReference.

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

A utility function to check if this event is an EntityReference.

Returns:boolean

true if the event is EntityReference, false otherwise

isNamespaceback to summary
public boolean isNamespace()

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

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

Returns:boolean

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

true if the event is Namespace, false otherwise

See Also
Namespace
isProcessingInstructionback to summary
public boolean isProcessingInstruction()

Implements javax.xml.stream.events.XMLEvent.isProcessingInstruction.

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

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

Returns:boolean

true if the event is ProcessingInstruction, false otherwise

isStartDocumentback to summary
public boolean 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

isStartElementback to summary
public boolean 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

setEventTypeback to summary
protected void setEventType(int eventType)
setLocationback to summary
pack-priv void setLocation(Location loc)
writeAsEncodedUnicodeback to summary
public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException

Implements 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
writeAsEncodedUnicodeExback to summary
protected abstract void writeAsEncodedUnicodeEx(Writer writer) throws IOException, XMLStreamException

Helper method in order to expose IOException.

Parameters
writer:Writer

The writer that will output the data

Exceptions
IOException:
if there is an IO error
XMLStreamException:
if there is a fatal error writing the event
com.sun.xml.internal.stream.events back to summary

pack-priv Class DummyEvent.DummyLocation

extends Object
implements Location
Class Inheritance
All Implemented Interfaces
javax.xml.stream.Location

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Return the byte or character offset into the input source this location is pointing to.

public int
getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Return the column number where the current event ends, returns -1 if none is available.

public int
getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Return the line number where the current event ends, returns -1 if none is available.

public String
getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Returns the public ID of the XML

public String
getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Returns the system ID of the XML

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DummyLocationback to summary
public DummyLocation()

Method Detail

getCharacterOffsetback to summary
public int getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Doc from javax.xml.stream.Location.getCharacterOffset.

Return the byte or character offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.

Returns:int

the current offset

getColumnNumberback to summary
public int getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Doc from javax.xml.stream.Location.getColumnNumber.

Return the column number where the current event ends, returns -1 if none is available.

Returns:int

the current column number

getLineNumberback to summary
public int getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Doc from javax.xml.stream.Location.getLineNumber.

Return the line number where the current event ends, returns -1 if none is available.

Returns:int

the current line number

getPublicIdback to summary
public String getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Doc from javax.xml.stream.Location.getPublicId.

Returns the public ID of the XML

Returns:String

the public ID, or null if not available

getSystemIdback to summary
public String getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Doc from javax.xml.stream.Location.getSystemId.

Returns the system ID of the XML

Returns:String

the system ID, or null if not available