public abstract class EventBase extends Object implements XMLEvent
Modifier and Type | Field and Description |
---|---|
protected int |
_eventType |
protected Location |
_location |
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Modifier and Type | Method and Description |
---|---|
Characters |
asCharacters()
Returns this event as Characters, may result in
a class cast exception if this event is not Characters.
|
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.
|
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.
|
int |
getEventType()
Returns an integer code for this event.
|
Location |
getLocation()
Return the location of this event.
|
QName |
getSchemaType()
This method is provided for implementations to provide
optional type information about the associated event.
|
String |
getSystemId() |
boolean |
isAttribute()
A utility function to check if this event is an Attribute.
|
boolean |
isCharacters()
A utility function to check if this event is Characters.
|
boolean |
isEndDocument() |
boolean |
isEndElement() |
boolean |
isEntityReference() |
boolean |
isNamespace()
A utility function to check if this event is a Namespace.
|
boolean |
isProcessingInstruction() |
boolean |
isStartDocument() |
boolean |
isStartElement() |
protected void |
setEventType(int eventType) |
void |
setLocation(Location loc) |
void |
writeAsEncodedUnicode(Writer writer)
This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
|
protected int _eventType
protected Location _location
public int getEventType()
getEventType
in interface XMLEvent
protected void setEventType(int eventType)
public boolean isStartElement()
isStartElement
in interface XMLEvent
public boolean isEndElement()
isEndElement
in interface XMLEvent
public boolean isEntityReference()
isEntityReference
in interface XMLEvent
public boolean isProcessingInstruction()
isProcessingInstruction
in interface XMLEvent
public boolean isStartDocument()
isStartDocument
in interface XMLEvent
public boolean isEndDocument()
isEndDocument
in interface XMLEvent
public Location getLocation()
getLocation
in interface XMLEvent
Location
public void setLocation(Location loc)
public String getSystemId()
public Characters asCharacters()
asCharacters
in interface XMLEvent
public EndElement asEndElement()
asEndElement
in interface XMLEvent
public StartElement asStartElement()
asStartElement
in interface XMLEvent
public QName getSchemaType()
getSchemaType
in interface XMLEvent
public boolean isAttribute()
isAttribute
in interface XMLEvent
Attribute
public boolean isCharacters()
isCharacters
in interface XMLEvent
Characters
public boolean isNamespace()
isNamespace
in interface XMLEvent
Namespace
public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException
writeAsEncodedUnicode
in interface XMLEvent
writer
- The writer that will output the dataXMLStreamException
- if there is a fatal error writing the eventCopyright © 2023 Oracle Corpration. All rights reserved.