- All Superinterfaces:
- XMLStreamConstants
- All Known Subinterfaces:
- Attribute,- Characters,- Comment,- DTD,- EndDocument,- EndElement,- EntityDeclaration,- EntityReference,- Namespace,- NotationDeclaration,- ProcessingInstruction,- StartDocument,- StartElement
This is the base event interface for handling markup events.
 Events are value objects that are used to communicate the
 XML 1.0 InfoSet to the Application.  Events may be cached
 and referenced after the parse has completed.
- Since:
- 1.6
- See Also:
- 
Field SummaryFields declared in interface javax.xml.stream.XMLStreamConstantsATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
- 
Method SummaryModifier and TypeMethodDescriptionReturns this event as Characters, may result in a class cast exception if this event is not Characters.Returns this event as an end element event, may result in a class cast exception if this event is not a end element.Returns this event as a start element event, may result in a class cast exception if this event is not a start element.intReturns an integer code for this event.Return the location of this event.This method is provided for implementations to provide optional type information about the associated event.booleanA utility function to check if this event is an Attribute.booleanA utility function to check if this event is Characters.booleanA utility function to check if this event is an EndDocument.booleanA utility function to check if this event is a EndElement.booleanA utility function to check if this event is an EntityReference.booleanA utility function to check if this event is a Namespace.booleanA utility function to check if this event is a ProcessingInstruction.booleanA utility function to check if this event is a StartDocument.booleanA utility function to check if this event is a StartElement.voidwriteAsEncodedUnicode(Writer writer) This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
- 
Method Details- 
getEventTypeint getEventType()Returns an integer code for this event.- Returns:
- the event type
- See Also:
 
- 
getLocationLocation getLocation()Return the location of this event. The Location returned from this method is non-volatile and will retain its information.- Returns:
- the location of the event
- See Also:
 
- 
isStartElementboolean isStartElement()A utility function to check if this event is a StartElement.- Returns:
- true if the event is StartElement, false otherwise
- See Also:
 
- 
isAttributeboolean isAttribute()A utility function to check if this event is an Attribute.- Returns:
- true if the event is Attribute, false otherwise
- See Also:
 
- 
isNamespaceboolean isNamespace()A utility function to check if this event is a Namespace.- Returns:
- true if the event is Namespace, false otherwise
- See Also:
 
- 
isEndElementboolean isEndElement()A utility function to check if this event is a EndElement.- Returns:
- true if the event is EndElement, false otherwise
- See Also:
 
- 
isEntityReferenceboolean isEntityReference()A utility function to check if this event is an EntityReference.- Returns:
- true if the event is EntityReference, false otherwise
- See Also:
 
- 
isProcessingInstructionboolean isProcessingInstruction()A utility function to check if this event is a ProcessingInstruction.- Returns:
- true if the event is ProcessingInstruction, false otherwise
- See Also:
 
- 
isCharactersboolean isCharacters()A utility function to check if this event is Characters.- Returns:
- true if the event is Characters, false otherwise
- See Also:
 
- 
isStartDocumentboolean isStartDocument()A utility function to check if this event is a StartDocument.- Returns:
- true if the event is StartDocument, false otherwise
- See Also:
 
- 
isEndDocumentboolean isEndDocument()A utility function to check if this event is an EndDocument.- Returns:
- true if the event is EndDocument, false otherwise
- See Also:
 
- 
asStartElementStartElement asStartElement()Returns this event as a start element event, may result in a class cast exception if this event is not a start element.- Returns:
- a StartElementevent
 
- 
asEndElementEndElement asEndElement()Returns this event as an end element event, may result in a class cast exception if this event is not a end element.- Returns:
- a EndElementevent
 
- 
asCharactersCharacters asCharacters()Returns this event as Characters, may result in a class cast exception if this event is not Characters.- Returns:
- a Charactersevent
 
- 
getSchemaTypeQName 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.- Returns:
- the type of the event, null if not available
 
- 
writeAsEncodedUnicodeThis 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.- Parameters:
- writer- The writer that will output the data
- Throws:
- XMLStreamException- if there is a fatal error writing the event
 
 
-