Package org.codehaus.stax2.ri.evt
Class BaseEventImpl
- java.lang.Object
-
- org.codehaus.stax2.ri.evt.BaseEventImpl
-
- All Implemented Interfaces:
XMLEvent,XMLStreamConstants,XMLEvent2
- Direct Known Subclasses:
AttributeEventImpl,CharactersEventImpl,CommentEventImpl,DTDEventImpl,EndDocumentEventImpl,EndElementEventImpl,EntityDeclarationEventImpl,EntityReferenceEventImpl,NotationDeclarationEventImpl,ProcInstrEventImpl,StartDocumentEventImpl,StartElementEventImpl
public abstract class BaseEventImpl extends Object implements XMLEvent2
This abstract base class implements common functionality for Stax2 reference implementation's event API part.- Author:
- Tatu Saloranta
-
-
Field Summary
Fields Modifier and Type Field Description protected LocationmLocationDeprecated.CallgetLocation()instead.-
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 Modifier Constructor Description protectedBaseEventImpl(Location loc)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static intaddHash(Iterator<?> it, int baseHash)CharactersasCharacters()EndElementasEndElement()StartElementasStartElement()abstract booleanequals(Object o)Declared abstract to force redefinition by sub-classesabstract intgetEventType()LocationgetLocation()QNamegetSchemaType()abstract inthashCode()Declared abstract to force redefinition by sub-classesbooleanisAttribute()booleanisCharacters()booleanisEndDocument()booleanisEndElement()booleanisEntityReference()booleanisNamespace()booleanisProcessingInstruction()booleanisStartDocument()booleanisStartElement()protected static booleaniteratedEquals(Iterator<?> it1, Iterator<?> it2)protected static booleanstringsWithNullsEqual(String s1, String s2)Comparison method that will consider null Strings to be equivalent to empty Strings for comparison purposes; and compare equality with that caveat.protected voidthrowFromIOE(IOException ioe)StringtoString()abstract voidwriteAsEncodedUnicode(Writer w)abstract voidwriteUsing(XMLStreamWriter2 w)
-
-
-
Field Detail
-
mLocation
@Deprecated protected final Location mLocation
Deprecated.CallgetLocation()instead.Location where token started; exact definition may depends on event type.TODO: remove direct dependencies to this by sub-classes; rename
-
-
Constructor Detail
-
BaseEventImpl
protected BaseEventImpl(Location loc)
-
-
Method Detail
-
asCharacters
public Characters asCharacters()
- Specified by:
asCharactersin interfaceXMLEvent
-
asEndElement
public EndElement asEndElement()
- Specified by:
asEndElementin interfaceXMLEvent
-
asStartElement
public StartElement asStartElement()
- Specified by:
asStartElementin interfaceXMLEvent
-
getEventType
public abstract int getEventType()
- Specified by:
getEventTypein interfaceXMLEvent
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceXMLEvent
-
getSchemaType
public QName getSchemaType()
- Specified by:
getSchemaTypein 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
-
writeAsEncodedUnicode
public abstract void writeAsEncodedUnicode(Writer w) throws XMLStreamException
- Specified by:
writeAsEncodedUnicodein interfaceXMLEvent- Throws:
XMLStreamException
-
writeUsing
public abstract void writeUsing(XMLStreamWriter2 w) throws XMLStreamException
- Specified by:
writeUsingin interfaceXMLEvent2- Throws:
XMLStreamException
-
equals
public abstract boolean equals(Object o)
Declared abstract to force redefinition by sub-classes
-
hashCode
public abstract int hashCode()
Declared abstract to force redefinition by sub-classes
-
throwFromIOE
protected void throwFromIOE(IOException ioe) throws XMLStreamException
- Throws:
XMLStreamException
-
stringsWithNullsEqual
protected static boolean stringsWithNullsEqual(String s1, String s2)
Comparison method that will consider null Strings to be equivalent to empty Strings for comparison purposes; and compare equality with that caveat.
-
addHash
protected static int addHash(Iterator<?> it, int baseHash)
-
-