org.codehaus.stax2.ri.evt
Class BaseEventImpl

java.lang.Object
  extended by org.codehaus.stax2.ri.evt.BaseEventImpl
All Implemented Interfaces:
javax.xml.stream.events.XMLEvent, javax.xml.stream.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
protected  javax.xml.stream.Location mLocation
          Location where token started; exact definition may depends on event 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
protected BaseEventImpl(javax.xml.stream.Location loc)
           
 
Method Summary
protected static int addHash(Iterator it, int baseHash)
           
 javax.xml.stream.events.Characters asCharacters()
           
 javax.xml.stream.events.EndElement asEndElement()
           
 javax.xml.stream.events.StartElement asStartElement()
           
abstract  boolean equals(Object o)
          Declared abstract to force redefinition by sub-classes
abstract  int getEventType()
           
 javax.xml.stream.Location getLocation()
           
 QName getSchemaType()
           
abstract  int hashCode()
          Declared abstract to force redefinition by sub-classes
 boolean isAttribute()
           
 boolean isCharacters()
           
 boolean isEndDocument()
           
 boolean isEndElement()
           
 boolean isEntityReference()
           
 boolean isNamespace()
           
 boolean isProcessingInstruction()
           
 boolean isStartDocument()
           
 boolean isStartElement()
           
protected static boolean iteratedEquals(Iterator it1, Iterator it2)
           
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.
protected  void throwFromIOE(IOException ioe)
           
 String toString()
           
abstract  void writeAsEncodedUnicode(Writer w)
           
abstract  void writeUsing(XMLStreamWriter2 w)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mLocation

protected final javax.xml.stream.Location mLocation
Location where token started; exact definition may depends on event type.

Constructor Detail

BaseEventImpl

protected BaseEventImpl(javax.xml.stream.Location loc)
Method Detail

asCharacters

public javax.xml.stream.events.Characters asCharacters()
Specified by:
asCharacters in interface javax.xml.stream.events.XMLEvent

asEndElement

public javax.xml.stream.events.EndElement asEndElement()
Specified by:
asEndElement in interface javax.xml.stream.events.XMLEvent

asStartElement

public javax.xml.stream.events.StartElement asStartElement()
Specified by:
asStartElement in interface javax.xml.stream.events.XMLEvent

getEventType

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

getLocation

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

getSchemaType

public QName getSchemaType()
Specified by:
getSchemaType in interface javax.xml.stream.events.XMLEvent

isAttribute

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

isCharacters

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

isEndDocument

public boolean isEndDocument()
Specified by:
isEndDocument 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

isNamespace

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

isProcessingInstruction

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

isStartDocument

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

isStartElement

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

writeAsEncodedUnicode

public abstract void writeAsEncodedUnicode(Writer w)
                                    throws javax.xml.stream.XMLStreamException
Specified by:
writeAsEncodedUnicode in interface javax.xml.stream.events.XMLEvent
Throws:
javax.xml.stream.XMLStreamException

writeUsing

public abstract void writeUsing(XMLStreamWriter2 w)
                         throws javax.xml.stream.XMLStreamException
Specified by:
writeUsing in interface XMLEvent2
Throws:
javax.xml.stream.XMLStreamException

equals

public abstract boolean equals(Object o)
Declared abstract to force redefinition by sub-classes

Overrides:
equals in class Object

hashCode

public abstract int hashCode()
Declared abstract to force redefinition by sub-classes

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

throwFromIOE

protected void throwFromIOE(IOException ioe)
                     throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.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.


iteratedEquals

protected static boolean iteratedEquals(Iterator it1,
                                        Iterator it2)

addHash

protected static int addHash(Iterator it,
                             int baseHash)


Copyright © 2005-2012 Oracle Corporation. All Rights Reserved.