java.lang.Object
com.sun.xml.fastinfoset.stax.events.EventBase
All Implemented Interfaces:
XMLEvent, XMLStreamConstants
Direct Known Subclasses:
AttributeBase, CharactersEvent, CommentEvent, DTDEvent, EndDocumentEvent, EndElementEvent, EntityDeclarationImpl, EntityReferenceEvent, ProcessingInstructionEvent, StartDocumentEvent, StartElementEvent

public abstract class EventBase extends Object implements XMLEvent
  • Field Details

    • _eventType

      protected int _eventType
    • _location

      protected Location _location
  • Constructor Details

    • EventBase

      protected EventBase()
    • EventBase

      protected EventBase(int eventType)
  • Method Details

    • getEventType

      public int getEventType()
      Returns an integer code for this event.
      Specified by:
      getEventType in interface XMLEvent
    • setEventType

      protected final void setEventType(int eventType)
    • isStartElement

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

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

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

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

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

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

      public Location getLocation()
      Return the location of this event. The Location returned from this method is non-volatile and will retain its information.
      Specified by:
      getLocation in interface XMLEvent
      See Also:
    • setLocation

      public void setLocation(Location loc)
    • getSystemId

      public String getSystemId()
    • asCharacters

      public 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 XMLEvent
    • asEndElement

      public 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 XMLEvent
    • asStartElement

      public 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 XMLEvent
    • getSchemaType

      public 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 XMLEvent
    • isAttribute

      public boolean isAttribute()
      A utility function to check if this event is an Attribute.
      Specified by:
      isAttribute in interface XMLEvent
      See Also:
    • isCharacters

      public boolean isCharacters()
      A utility function to check if this event is Characters.
      Specified by:
      isCharacters in interface XMLEvent
      See Also:
    • isNamespace

      public boolean isNamespace()
      A utility function to check if this event is a Namespace.
      Specified by:
      isNamespace in interface XMLEvent
      See Also:
    • writeAsEncodedUnicode

      public void writeAsEncodedUnicode(Writer writer) throws 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 XMLEvent
      Parameters:
      writer - The writer that will output the data
      Throws:
      XMLStreamException - if there is a fatal error writing the event
    • getEventTypeString

      private String getEventTypeString()