Package javanet.staxutils.events
Class AbstractXMLEvent
- java.lang.Object
-
- javanet.staxutils.events.AbstractXMLEvent
-
- All Implemented Interfaces:
Serializable,Cloneable,ExtendedXMLEvent,XMLEvent,XMLStreamConstants
- Direct Known Subclasses:
AbstractCharactersEvent,AttributeEvent,CommentEvent,DTDEvent,EndDocumentEvent,EndElementEvent,EntityDeclarationEvent,EntityReferenceEvent,NotationDeclarationEvent,ProcessingInstructionEvent,StartDocumentEvent,StartElementEvent
public abstract class AbstractXMLEvent extends Object implements ExtendedXMLEvent, Serializable, Cloneable
Abstract base class forXMLEventimplementations.- Version:
- $Revision: 1.3 $
- Author:
- Christian Niles
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LocationlocationThe event location.protected QNameschemaTypeThe 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
Constructors Constructor Description AbstractXMLEvent()AbstractXMLEvent(XMLEvent that)AbstractXMLEvent(Location location)AbstractXMLEvent(Location location, QName schemaType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharactersasCharacters()EndElementasEndElement()StartElementasStartElement()Objectclone()LocationgetLocation()QNamegetSchemaType()booleanisAttribute()booleanisCharacters()booleanisEndDocument()booleanisEndElement()booleanisEntityReference()booleanisNamespace()booleanisProcessingInstruction()booleanisStartDocument()booleanisStartElement()booleanmatches(XMLEvent event)Determines if this event matches another event, irrespective of document location.StringtoString()voidwriteAsEncodedUnicode(Writer writer)voidwriteEvent(XMLStreamWriter writer)Writes the event to the providedXMLStreamWriter.-
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
-
-
-
-
Method Detail
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceXMLEvent
-
getSchemaType
public QName getSchemaType()
- Specified by:
getSchemaTypein interfaceXMLEvent
-
asCharacters
public Characters asCharacters()
- Specified by:
asCharactersin interfaceXMLEvent
-
asEndElement
public EndElement asEndElement()
- Specified by:
asEndElementin interfaceXMLEvent
-
asStartElement
public StartElement asStartElement()
- Specified by:
asStartElementin interfaceXMLEvent
-
isAttribute
public boolean isAttribute()
- Specified by:
isAttributein interfaceXMLEvent
-
isCharacters
public boolean isCharacters()
- Specified by:
isCharactersin interfaceXMLEvent
-
isEndDocument
public boolean isEndDocument()
- Specified by:
isEndDocumentin interfaceXMLEvent
-
isEndElement
public boolean isEndElement()
- Specified by:
isEndElementin interfaceXMLEvent
-
isEntityReference
public boolean isEntityReference()
- Specified by:
isEntityReferencein interfaceXMLEvent
-
isNamespace
public boolean isNamespace()
- Specified by:
isNamespacein interfaceXMLEvent
-
isProcessingInstruction
public boolean isProcessingInstruction()
- Specified by:
isProcessingInstructionin interfaceXMLEvent
-
isStartDocument
public boolean isStartDocument()
- Specified by:
isStartDocumentin interfaceXMLEvent
-
isStartElement
public boolean isStartElement()
- Specified by:
isStartElementin interfaceXMLEvent
-
matches
public boolean matches(XMLEvent event)
Description copied from interface:ExtendedXMLEventDetermines if this event matches another event, irrespective of document location.- Specified by:
matchesin interfaceExtendedXMLEvent- Parameters:
event- The event to match against.- Returns:
trueif the two events match,falseotherwise.
-
writeEvent
public void writeEvent(XMLStreamWriter writer) throws XMLStreamException
Description copied from interface:ExtendedXMLEventWrites the event to the providedXMLStreamWriter.- Specified by:
writeEventin interfaceExtendedXMLEvent- Parameters:
writer- The destination stream.- Throws:
XMLStreamException- If an error occurs writing to the destination stream.
-
writeAsEncodedUnicode
public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException
- Specified by:
writeAsEncodedUnicodein interfaceXMLEvent- Throws:
XMLStreamException
-
-