Package gov.nasa.worldwind.ogc.kml
Class KMLParserContext
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.util.xml.BasicXMLEventParserContext
-
- gov.nasa.worldwind.ogc.kml.KMLParserContext
-
- All Implemented Interfaces:
AVList,XMLEventParserContext
public class KMLParserContext extends BasicXMLEventParserContext
The parser context for KML and KMZ docuements. Specifies the classes used to parse each type of KML element.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String[]BooleanFieldsThe names of elements that contain merely boolean integer (0 or 1) data and can be parsed by a generic boolean integer parser.protected static javax.xml.namespace.QNameCOORDINATESThe key used to identify the coordinates parser in the parser context's parser map.protected KMLCoordinatesParsercoordinatesParserprotected static java.lang.String[]DoubleFieldsThe names of elements that contain merely double data and can be parsed by a generic double parser.protected static java.lang.String[]IntegerFieldsThe names of elements that contain merely integer data and can be parsed by a generic integer parser.protected static java.lang.String[]StringFieldsThe names of elements that contain merely string data and can be parsed by a generic string parser.-
Fields inherited from class gov.nasa.worldwind.util.xml.BasicXMLEventParserContext
BOOLEAN, BOOLEAN_INTEGER, booleanIntegerParser, booleanParser, defaultNamespaceURI, DOUBLE, doubleParser, idTable, INTEGER, integerParser, notificationListener, parsers, reader, STRING, stringParser, UNRECOGNIZED
-
Fields inherited from interface gov.nasa.worldwind.util.xml.XMLEventParserContext
UNRECOGNIZED_ELEMENT_PARSER
-
-
Constructor Summary
Constructors Constructor Description KMLParserContext(KMLParserContext ctx)KMLParserContext(java.lang.String defaultNamespace)Creates a parser context instance.KMLParserContext(javax.xml.stream.XMLEventReader eventReader, java.lang.String defaultNamespace)Creates a parser context instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KMLCoordinatesParsergetCoordinatesParser()Get the default coordinates parser.protected voidinitializeCompanionParsers()protected voidinitializeParsers()Loads the parser map with the parser to use for each element type.protected voidinitializeParsers(java.lang.String ns)protected voidinitializeVersion2dot0Parsers()protected voidinitializeVersion2dot1Parsers()protected voidinitializeVersion2dot2Parsers()-
Methods inherited from class gov.nasa.worldwind.util.xml.BasicXMLEventParserContext
addBooleanIntegerParsers, addBooleanParsers, addDoubleParsers, addId, addIntegerParsers, addStringParsers, allocate, allocate, getBooleanIntegerParser, getBooleanParser, getCharacters, getDefaultNamespaceURI, getDoubleParser, getEventReader, getIdTable, getIntegerParser, getParser, getParser, getParser, getStringParser, getUnrecognizedElementParser, hasNext, initialize, initializeDefaultNotificationListener, isDefaultNamespace, isEndElement, isEndElementEvent, isNullNamespace, isSameAttributeName, isSameName, isStartElement, isStartElement, nextEvent, registerParser, setDefaultNamespaceURI, setEventReader, setNotificationListener
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
-
-
-
Field Detail
-
coordinatesParser
protected KMLCoordinatesParser coordinatesParser
-
COORDINATES
protected static javax.xml.namespace.QName COORDINATES
The key used to identify the coordinates parser in the parser context's parser map.
-
StringFields
protected static final java.lang.String[] StringFields
The names of elements that contain merely string data and can be parsed by a generic string parser.
-
DoubleFields
protected static final java.lang.String[] DoubleFields
The names of elements that contain merely double data and can be parsed by a generic double parser.
-
IntegerFields
protected static final java.lang.String[] IntegerFields
The names of elements that contain merely integer data and can be parsed by a generic integer parser.
-
BooleanFields
protected static final java.lang.String[] BooleanFields
The names of elements that contain merely boolean integer (0 or 1) data and can be parsed by a generic boolean integer parser.
-
-
Constructor Detail
-
KMLParserContext
public KMLParserContext(java.lang.String defaultNamespace)
Creates a parser context instance.- Parameters:
defaultNamespace- the default namespace. If null,KMLConstants.KML_NAMESPACEis used.
-
KMLParserContext
public KMLParserContext(javax.xml.stream.XMLEventReader eventReader, java.lang.String defaultNamespace)Creates a parser context instance.- Parameters:
eventReader- the event reader from which to read events.defaultNamespace- the default namespace. If null,KMLConstants.KML_NAMESPACEis used.
-
KMLParserContext
public KMLParserContext(KMLParserContext ctx)
-
-
Method Detail
-
initializeParsers
protected void initializeParsers()
Loads the parser map with the parser to use for each element type. The parser may be changed by callingBasicXMLEventParserContext.registerParser(javax.xml.namespace.QName, gov.nasa.worldwind.util.xml.XMLEventParser).- Overrides:
initializeParsersin classBasicXMLEventParserContext
-
initializeVersion2dot2Parsers
protected void initializeVersion2dot2Parsers()
-
initializeParsers
protected void initializeParsers(java.lang.String ns)
-
initializeVersion2dot1Parsers
protected void initializeVersion2dot1Parsers()
-
initializeVersion2dot0Parsers
protected void initializeVersion2dot0Parsers()
-
initializeCompanionParsers
protected void initializeCompanionParsers()
-
getCoordinatesParser
public KMLCoordinatesParser getCoordinatesParser()
Get the default coordinates parser.- Returns:
- the default coordinates parser.
-
-