Class EventBase
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
-
Field Summary
FieldsFields 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 -
Method Summary
Modifier 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.booleanbooleanbooleanbooleanA utility function to check if this event is a Namespace.booleanbooleanbooleanprotected voidsetEventType(int eventType) voidsetLocation(Location loc) voidwriteAsEncodedUnicode(Writer writer) This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
-
Field Details
-
_eventType
protected int _eventType -
_location
-
-
Constructor Details
-
EventBase
public EventBase() -
EventBase
public EventBase(int eventType)
-
-
Method Details
-
getEventType
public int getEventType()Returns an integer code for this event.- Specified by:
getEventTypein interfaceXMLEvent
-
setEventType
protected void setEventType(int eventType) -
isStartElement
public boolean isStartElement()- Specified by:
isStartElementin interfaceXMLEvent
-
isEndElement
public boolean isEndElement()- Specified by:
isEndElementin interfaceXMLEvent
-
isEntityReference
public boolean isEntityReference()- Specified by:
isEntityReferencein interfaceXMLEvent
-
isProcessingInstruction
public boolean isProcessingInstruction()- Specified by:
isProcessingInstructionin interfaceXMLEvent
-
isStartDocument
public boolean isStartDocument()- Specified by:
isStartDocumentin interfaceXMLEvent
-
isEndDocument
public boolean isEndDocument()- Specified by:
isEndDocumentin interfaceXMLEvent
-
getLocation
Return the location of this event. The Location returned from this method is non-volatile and will retain its information.- Specified by:
getLocationin interfaceXMLEvent- See Also:
-
setLocation
-
getSystemId
-
asCharacters
Returns this event as Characters, may result in a class cast exception if this event is not Characters.- Specified by:
asCharactersin interfaceXMLEvent
-
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:
asEndElementin interfaceXMLEvent
-
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:
asStartElementin interfaceXMLEvent
-
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:
getSchemaTypein interfaceXMLEvent
-
isAttribute
public boolean isAttribute()A utility function to check if this event is an Attribute.- Specified by:
isAttributein interfaceXMLEvent- See Also:
-
isCharacters
public boolean isCharacters()A utility function to check if this event is Characters.- Specified by:
isCharactersin interfaceXMLEvent- See Also:
-
isNamespace
public boolean isNamespace()A utility function to check if this event is a Namespace.- Specified by:
isNamespacein interfaceXMLEvent- See Also:
-
writeAsEncodedUnicode
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:
writeAsEncodedUnicodein interfaceXMLEvent- Parameters:
writer- The writer that will output the data- Throws:
XMLStreamException- if there is a fatal error writing the event
-