public interface XMLEventParserContext extends AVList
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNRECOGNIZED_ELEMENT_PARSER
Identifies the name of the parser handling unrecognized elements.
|
Modifier and Type | Method and Description |
---|---|
void |
addBooleanIntegerParsers(java.lang.String namespace,
java.lang.String[] booleanIntegerFields)
Add boolean integer parsers for a list of element types and qualified for a specified namespace.
|
void |
addBooleanParsers(java.lang.String namespace,
java.lang.String[] booleanFields)
Add boolean parsers for a list of element types and qualified for a specified namespace.
|
void |
addDoubleParsers(java.lang.String namespace,
java.lang.String[] doubleFields)
Add double parsers for a list of element types and qualified for a specified namespace.
|
void |
addId(java.lang.String id,
java.lang.Object o)
Adds a mapping of an id attribute to its associated KML object.
|
void |
addIntegerParsers(java.lang.String namespace,
java.lang.String[] integerFields)
Add integer parsers for a list of element types and qualified for a specified namespace.
|
void |
addStringParsers(java.lang.String namespace,
java.lang.String[] stringFields)
Add string list parsers for a list of element types and qualified for a specified namespace.
|
XMLEventParser |
allocate(javax.xml.stream.events.XMLEvent event)
Create a parser for a specified event's element name, if a parser for that name is registered with the context.
|
XMLEventParser |
allocate(javax.xml.stream.events.XMLEvent event,
XMLEventParser defaultParser)
Create a parser for a specified event's element name, if a parser for that name is registered with the context.
|
BooleanIntegerXMLEventParser |
getBooleanIntegerParser()
Returns the default parser for a simple boolean integer (0 or 1).
|
BooleanXMLEventParser |
getBooleanParser()
Returns the default parser for a simple boolean.
|
java.lang.String |
getCharacters(javax.xml.stream.events.XMLEvent event)
Returns the text associated with the event.
|
java.lang.String |
getDefaultNamespaceURI()
Returns the context's default namespace URI.
|
DoubleXMLEventParser |
getDoubleParser()
Returns a parser for a simple double.
|
javax.xml.stream.XMLEventReader |
getEventReader()
Returns the event reader associated with the context.
|
java.util.Map<java.lang.String,java.lang.Object> |
getIdTable()
Returns the table associating objects with their id attribute as specified in the object's KML file.
|
IntegerXMLEventParser |
getIntegerParser()
Returns the default parser for a simple integer.
|
XMLEventParser |
getParser(javax.xml.namespace.QName eventName)
Returns a new parser for a specified element name.
|
XMLEventParser |
getParser(javax.xml.stream.events.XMLEvent event)
Returns a new parser for a specified event.
|
StringXMLEventParser |
getStringParser()
Returns the default parser for a simple string.
|
XMLEventParser |
getUnrecognizedElementParser()
Returns a parser to handle unrecognized elements.
|
boolean |
hasNext()
Indicates whether the event stream associated with this context contains another event.
|
boolean |
isDefaultNamespace(java.lang.String namespaceURI)
Indicates whether the specified namespace URI is the default namespace URI used by this parser context.
|
boolean |
isEndElement(javax.xml.stream.events.XMLEvent event,
javax.xml.stream.events.XMLEvent startElement)
Determines whether an event is the corresponding end element for a specified start event.
|
boolean |
isSameAttributeName(javax.xml.namespace.QName qa,
javax.xml.namespace.QName qb)
Determines whether two fully qualified attribute names are the same.
|
boolean |
isSameName(javax.xml.namespace.QName qa,
javax.xml.namespace.QName qb)
Determines whether two element names are the same.
|
boolean |
isStartElement(javax.xml.stream.events.XMLEvent event,
javax.xml.namespace.QName elementName)
Determines whether an event is a start event for a specific event type.
|
boolean |
isStartElement(javax.xml.stream.events.XMLEvent event,
java.lang.String elementName)
Determines whether an event is a start event for a specific event type indicated by its local name.
|
javax.xml.stream.events.XMLEvent |
nextEvent()
Returns the next event in the event stream associated with this context.
|
void |
registerParser(javax.xml.namespace.QName elementName,
XMLEventParser parser)
Registers a parser for a specified element name.
|
void |
setDefaultNamespaceURI(java.lang.String defaultNamespaceURI)
Specifies the context's default namespace URI.
|
void |
setNotificationListener(XMLParserNotificationListener listener)
Specify the object to receive notifications, which are sent when exceptions occur during parsing and when
unrecognized element types are encountered.
|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
static final java.lang.String UNRECOGNIZED_ELEMENT_PARSER
void addBooleanIntegerParsers(java.lang.String namespace, java.lang.String[] booleanIntegerFields)
namespace
- the namespace URI.booleanIntegerFields
- the string parser.void addBooleanParsers(java.lang.String namespace, java.lang.String[] booleanFields)
namespace
- the namespace URI.booleanFields
- the string parsers.void addDoubleParsers(java.lang.String namespace, java.lang.String[] doubleFields)
namespace
- the namespace URI.doubleFields
- the string parsers.void addId(java.lang.String id, java.lang.Object o)
id
- the object id. If null, this method returns without creating a mapping.o
- the object to associate with the id.void addIntegerParsers(java.lang.String namespace, java.lang.String[] integerFields)
namespace
- the namespace URI.integerFields
- the string parsers.void addStringParsers(java.lang.String namespace, java.lang.String[] stringFields)
namespace
- the namespace URI.stringFields
- the string list parser names.XMLEventParser allocate(javax.xml.stream.events.XMLEvent event)
event
- the event whose element name identifies the parser to create.XMLEventParser allocate(javax.xml.stream.events.XMLEvent event, XMLEventParser defaultParser)
event
- the event whose element name identifies the parser to create.defaultParser
- a parser to return if no parser is registered for the specified name. May be null.BooleanIntegerXMLEventParser getBooleanIntegerParser()
BooleanXMLEventParser getBooleanParser()
java.lang.String getCharacters(javax.xml.stream.events.XMLEvent event)
event
- the event of interest.java.lang.String getDefaultNamespaceURI()
setDefaultNamespaceURI(String)
DoubleXMLEventParser getDoubleParser()
javax.xml.stream.XMLEventReader getEventReader()
java.util.Map<java.lang.String,java.lang.Object> getIdTable()
IntegerXMLEventParser getIntegerParser()
XMLEventParser getParser(javax.xml.namespace.QName eventName)
eventName
- indicates the element name for which a parser is created.XMLEventParser getParser(javax.xml.stream.events.XMLEvent event)
event
- indicates the element name for which a parser is created.StringXMLEventParser getStringParser()
XMLEventParser getUnrecognizedElementParser()
UnrecognizedXMLEventParser
.boolean hasNext()
XMLEventReader.hasNext()
boolean isDefaultNamespace(java.lang.String namespaceURI)
namespaceURI
- the namespace URI to check.boolean isEndElement(javax.xml.stream.events.XMLEvent event, javax.xml.stream.events.XMLEvent startElement)
event
- the event of interest.startElement
- the start event associated with the potential end event.boolean isSameAttributeName(javax.xml.namespace.QName qa, javax.xml.namespace.QName qb)
qa
- the first attribute name.qb
- the second attribute name.boolean isSameName(javax.xml.namespace.QName qa, javax.xml.namespace.QName qb)
qa
- first element nameqb
- second element nameboolean isStartElement(javax.xml.stream.events.XMLEvent event, javax.xml.namespace.QName elementName)
event
- an event identifying the event type of interest.elementName
- the event name.boolean isStartElement(javax.xml.stream.events.XMLEvent event, java.lang.String elementName)
event
- an event identifying the event type of interest.elementName
- the local part of the event name to match.javax.xml.stream.events.XMLEvent nextEvent() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
- if there is an error with the underlying XML.XMLEventReader.nextEvent()
void registerParser(javax.xml.namespace.QName elementName, XMLEventParser parser)
getParser(javax.xml.stream.events.XMLEvent)
is called for the same element name.elementName
- the element name for which to return a parser.parser
- the parser to register.void setDefaultNamespaceURI(java.lang.String defaultNamespaceURI)
defaultNamespaceURI
- the default namespace URI.getDefaultNamespaceURI()
,
isSameName(javax.xml.namespace.QName, javax.xml.namespace.QName)
void setNotificationListener(XMLParserNotificationListener listener)
XMLParserNotification
for
more information.
The parser context may have only one notification listener. That listener may be changed at any time.listener
- the object to receive notification events.