com.sun.xml.stream.events
Class DummyEvent

java.lang.Object
  extended by com.sun.xml.stream.events.DummyEvent
All Implemented Interfaces:
javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Direct Known Subclasses:
AttributeImpl, CharacterEvent, CommentEvent, DTDEvent, EndDocumentEvent, EndElementEvent, EntityDeclarationImpl, EntityReferenceEvent, NamedEvent, NotationDeclarationImpl, ProcessingInstructionEvent, StartDocumentEvent, StartElementEvent

public abstract class DummyEvent
extends java.lang.Object
implements javax.xml.stream.events.XMLEvent

DummyEvent is an abstract class. It provides functionality for most of the function of XMLEvent.

Author:
Neeraj Bajaj Sun Microsystems,Inc., K.Venugopal Sun Microsystems,Inc.

Field Summary
protected  javax.xml.stream.Location fLocation
           
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
DummyEvent()
           
DummyEvent(int i)
           
 
Method Summary
 javax.xml.stream.events.Characters asCharacters()
          Returns this event as Characters, may result in a class cast exception if this event is not Characters.
 javax.xml.stream.events.EndElement asEndElement()
          Returns this event as an end element event, may result in a class cast exception if this event is not a end element.
 javax.xml.stream.events.StartElement asStartElement()
          Returns this event as a start element event, may result in a class cast exception if this event is not a start element.
 int getEventType()
           
 javax.xml.stream.Location getLocation()
           
 javax.xml.namespace.QName getSchemaType()
          This method is provided for implementations to provide optional type information about the associated event.
 boolean isAttribute()
          A utility function to check if this event is an Attribute.
 boolean isCharacterData()
           
 boolean isCharacters()
          A utility function to check if this event is Characters.
 boolean isEndDocument()
           
 boolean isEndElement()
           
 boolean isEntityReference()
           
 boolean isNamespace()
          A utility function to check if this event is a Namespace.
 boolean isProcessingInstruction()
           
 boolean isStartDocument()
           
 boolean isStartElement()
           
protected  void setEventType(int eventType)
           
 void writeAsEncodedUnicode(java.io.Writer writer)
          This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLocation

protected javax.xml.stream.Location fLocation
Constructor Detail

DummyEvent

public DummyEvent()

DummyEvent

public DummyEvent(int i)
Method Detail

getEventType

public int getEventType()
Specified by:
getEventType in interface javax.xml.stream.events.XMLEvent

setEventType

protected void setEventType(int eventType)

isStartElement

public boolean isStartElement()
Specified by:
isStartElement in interface javax.xml.stream.events.XMLEvent

isEndElement

public boolean isEndElement()
Specified by:
isEndElement in interface javax.xml.stream.events.XMLEvent

isEntityReference

public boolean isEntityReference()
Specified by:
isEntityReference in interface javax.xml.stream.events.XMLEvent

isProcessingInstruction

public boolean isProcessingInstruction()
Specified by:
isProcessingInstruction in interface javax.xml.stream.events.XMLEvent

isCharacterData

public boolean isCharacterData()

isStartDocument

public boolean isStartDocument()
Specified by:
isStartDocument in interface javax.xml.stream.events.XMLEvent

isEndDocument

public boolean isEndDocument()
Specified by:
isEndDocument in interface javax.xml.stream.events.XMLEvent

getLocation

public javax.xml.stream.Location getLocation()
Specified by:
getLocation in interface javax.xml.stream.events.XMLEvent

asCharacters

public javax.xml.stream.events.Characters asCharacters()
Returns this event as Characters, may result in a class cast exception if this event is not Characters.

Specified by:
asCharacters in interface javax.xml.stream.events.XMLEvent

asEndElement

public javax.xml.stream.events.EndElement asEndElement()
Returns this event as an end element event, may result in a class cast exception if this event is not a end element.

Specified by:
asEndElement in interface javax.xml.stream.events.XMLEvent

asStartElement

public javax.xml.stream.events.StartElement asStartElement()
Returns this event as a start element event, may result in a class cast exception if this event is not a start element.

Specified by:
asStartElement in interface javax.xml.stream.events.XMLEvent

getSchemaType

public javax.xml.namespace.QName 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.

Specified by:
getSchemaType in interface javax.xml.stream.events.XMLEvent

isAttribute

public boolean isAttribute()
A utility function to check if this event is an Attribute.

Specified by:
isAttribute in interface javax.xml.stream.events.XMLEvent
See Also:
Attribute

isCharacters

public boolean isCharacters()
A utility function to check if this event is Characters.

Specified by:
isCharacters in interface javax.xml.stream.events.XMLEvent
See Also:
Characters

isNamespace

public boolean isNamespace()
A utility function to check if this event is a Namespace.

Specified by:
isNamespace in interface javax.xml.stream.events.XMLEvent
See Also:
Namespace

writeAsEncodedUnicode

public void writeAsEncodedUnicode(java.io.Writer writer)
                           throws javax.xml.stream.XMLStreamException
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.

Specified by:
writeAsEncodedUnicode in interface javax.xml.stream.events.XMLEvent
Parameters:
writer - The writer that will output the data
Throws:
XMLStreamException - if there is a fatal error writing the event


Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.