javanet.staxutils.events
Class AbstractXMLEvent

java.lang.Object
  extended by javanet.staxutils.events.AbstractXMLEvent
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ExtendedXMLEvent, XMLEvent, XMLStreamConstants
Direct Known Subclasses:
AbstractCharactersEvent, AttributeEvent, CommentEvent, DTDEvent, EndDocumentEvent, EndElementEvent, EntityDeclarationEvent, EntityReferenceEvent, NotationDeclarationEvent, ProcessingInstructionEvent, StartDocumentEvent, StartElementEvent

public abstract class AbstractXMLEvent
extends java.lang.Object
implements ExtendedXMLEvent, java.io.Serializable, java.lang.Cloneable

Abstract base class for XMLEvent implementations.

Version:
$Revision: 1.3 $
Author:
Christian Niles
See Also:
Serialized Form

Field Summary
protected  Location location
          The event location.
protected  QName schemaType
          The schema type.
 
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
AbstractXMLEvent()
           
AbstractXMLEvent(Location location)
           
AbstractXMLEvent(Location location, QName schemaType)
           
AbstractXMLEvent(XMLEvent that)
           
 
Method Summary
 Characters asCharacters()
           
 EndElement asEndElement()
           
 StartElement asStartElement()
           
 java.lang.Object clone()
           
 Location getLocation()
           
 QName getSchemaType()
           
 boolean isAttribute()
           
 boolean isCharacters()
           
 boolean isEndDocument()
           
 boolean isEndElement()
           
 boolean isEntityReference()
           
 boolean isNamespace()
           
 boolean isProcessingInstruction()
           
 boolean isStartDocument()
           
 boolean isStartElement()
           
 boolean matches(XMLEvent event)
          Determines if this event matches another event, irrespective of document location.
 java.lang.String toString()
           
 void writeAsEncodedUnicode(java.io.Writer writer)
           
 void writeEvent(XMLStreamWriter writer)
          Writes the event to the provided XMLStreamWriter.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.stream.events.XMLEvent
getEventType
 

Field Detail

location

protected Location location
The event location.


schemaType

protected QName schemaType
The schema type.

Constructor Detail

AbstractXMLEvent

public AbstractXMLEvent()

AbstractXMLEvent

public AbstractXMLEvent(Location location)

AbstractXMLEvent

public AbstractXMLEvent(Location location,
                        QName schemaType)

AbstractXMLEvent

public AbstractXMLEvent(XMLEvent that)
Method Detail

getLocation

public Location getLocation()
Specified by:
getLocation in interface XMLEvent

getSchemaType

public QName getSchemaType()
Specified by:
getSchemaType in interface XMLEvent

asCharacters

public Characters asCharacters()
Specified by:
asCharacters in interface XMLEvent

asEndElement

public EndElement asEndElement()
Specified by:
asEndElement in interface XMLEvent

asStartElement

public StartElement asStartElement()
Specified by:
asStartElement in interface XMLEvent

isAttribute

public boolean isAttribute()
Specified by:
isAttribute in interface XMLEvent

isCharacters

public boolean isCharacters()
Specified by:
isCharacters in interface XMLEvent

isEndDocument

public boolean isEndDocument()
Specified by:
isEndDocument in interface XMLEvent

isEndElement

public boolean isEndElement()
Specified by:
isEndElement in interface XMLEvent

isEntityReference

public boolean isEntityReference()
Specified by:
isEntityReference in interface XMLEvent

isNamespace

public boolean isNamespace()
Specified by:
isNamespace in interface XMLEvent

isProcessingInstruction

public boolean isProcessingInstruction()
Specified by:
isProcessingInstruction in interface XMLEvent

isStartDocument

public boolean isStartDocument()
Specified by:
isStartDocument in interface XMLEvent

isStartElement

public boolean isStartElement()
Specified by:
isStartElement in interface XMLEvent

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

matches

public boolean matches(XMLEvent event)
Description copied from interface: ExtendedXMLEvent
Determines if this event matches another event, irrespective of document location.

Specified by:
matches in interface ExtendedXMLEvent
Parameters:
event - The event to match against.
Returns:
true if the two events match, false otherwise.

writeEvent

public void writeEvent(XMLStreamWriter writer)
                throws XMLStreamException
Description copied from interface: ExtendedXMLEvent
Writes the event to the provided XMLStreamWriter.

Specified by:
writeEvent in interface ExtendedXMLEvent
Parameters:
writer - The destination stream.
Throws:
XMLStreamException - If an error occurs writing to the destination stream.

writeAsEncodedUnicode

public void writeAsEncodedUnicode(java.io.Writer writer)
                           throws XMLStreamException
Specified by:
writeAsEncodedUnicode in interface XMLEvent
Throws:
XMLStreamException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object