Package gov.nasa.worldwind.ogc
Class OGCCapabilities
- java.lang.Object
-
- gov.nasa.worldwind.util.xml.AbstractXMLEventParser
-
- gov.nasa.worldwind.ogc.OGCCapabilities
-
- All Implemented Interfaces:
XMLEventParser
- Direct Known Subclasses:
WMSCapabilities
public abstract class OGCCapabilities extends AbstractXMLEventParser
Parses OGC Capabilities documents and holds the parsed information.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.xml.namespace.QNameCAPABILITYprotected OGCCapabilityInformationcapabilityInformationprotected javax.xml.stream.XMLEventReadereventReaderprotected XMLEventParserContextparserContextprotected javax.xml.namespace.QNameSERVICEprotected OGCServiceInformationserviceInformationprotected javax.xml.namespace.QNameUPDATE_SEQUENCEprotected java.lang.StringupdateSequenceprotected java.lang.Stringversionprotected javax.xml.namespace.QNameVERSION-
Fields inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
CHARACTERS_CONTENT, fields, namespaceURI, parent
-
-
Constructor Summary
Constructors Constructor Description OGCCapabilities(java.lang.String namespaceURI, java.lang.Object docSource)Create a new capabilities parser.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description XMLEventParserallocate(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event)Create a parser for a specified event.protected XMLEventParserContextcreateParserContext(javax.xml.stream.XMLEventReader reader)protected javax.xml.stream.XMLEventReadercreateReader(java.lang.Object docSource)protected voiddoParseEventAttributes(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args)Parse an event's attributes.protected voiddoParseEventContent(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args)Parse an event's sub-elements.OGCCapabilityInformationgetCapabilityInformation()Returns the document's capability information.abstract java.lang.StringgetDefaultNamespaceURI()Returns the default namespace URI.protected XMLEventParserContextgetParserContext()OGCServiceInformationgetServiceInformation()Returns the document's service information.java.lang.StringgetUpdateSequence()Returns the document's update sequence.java.lang.StringgetVersion()Returns the document's version number.abstract booleanisRootElementName(javax.xml.namespace.QName name)Determines whether a specified element name is the root element name of the schema.OGCCapabilitiesparse(java.lang.Object... args)Starts document parsing.protected voidsetCapabilityInformation(OGCCapabilityInformation capabilityInformation)protected voidsetServiceInformation(OGCServiceInformation serviceInformation)protected voidsetUpdateSequence(java.lang.String updateSequence)protected voidsetVersion(java.lang.String version)java.lang.StringtoString()-
Methods inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
doAddCharacters, doAddEventAttribute, doAddEventContent, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, getRoot, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parse, parseCharacterContent, removeField, setField, setField, setFields, setNamespaceURI, setParent
-
-
-
-
Field Detail
-
SERVICE
protected javax.xml.namespace.QName SERVICE
-
CAPABILITY
protected javax.xml.namespace.QName CAPABILITY
-
VERSION
protected javax.xml.namespace.QName VERSION
-
UPDATE_SEQUENCE
protected javax.xml.namespace.QName UPDATE_SEQUENCE
-
version
protected java.lang.String version
-
updateSequence
protected java.lang.String updateSequence
-
serviceInformation
protected OGCServiceInformation serviceInformation
-
capabilityInformation
protected OGCCapabilityInformation capabilityInformation
-
eventReader
protected javax.xml.stream.XMLEventReader eventReader
-
parserContext
protected XMLEventParserContext parserContext
-
-
Constructor Detail
-
OGCCapabilities
public OGCCapabilities(java.lang.String namespaceURI, java.lang.Object docSource)Create a new capabilities parser.- Parameters:
namespaceURI- the default namespace URI.docSource- the XML source. May be a filename, file, stream or other type allowed byWWXML.openEventReader(Object).- Throws:
java.lang.IllegalArgumentException- if the document source is null.
-
-
Method Detail
-
getDefaultNamespaceURI
public abstract java.lang.String getDefaultNamespaceURI()
Returns the default namespace URI. Must be overridden by subclasses to provide a specific URI. The default namespace is used to match XML elements found in the default namespace of the XML stream.- Returns:
- the default namespace URI.
-
isRootElementName
public abstract boolean isRootElementName(javax.xml.namespace.QName name)
Determines whether a specified element name is the root element name of the schema.- Parameters:
name- the name to test.- Returns:
- true if the name is the schema's root element, otherwise false.
-
createReader
protected javax.xml.stream.XMLEventReader createReader(java.lang.Object docSource)
-
createParserContext
protected XMLEventParserContext createParserContext(javax.xml.stream.XMLEventReader reader)
-
allocate
public XMLEventParser allocate(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event)
Create a parser for a specified event.- Overrides:
allocatein classAbstractXMLEventParser- Parameters:
ctx- the current parser context.event- the event for which the parser is created. Only the event type is used; the new parser can operate on any event of that type.- Returns:
- the new parser.
-
parse
public OGCCapabilities parse(java.lang.Object... args) throws javax.xml.stream.XMLStreamException
Starts document parsing. This method initiates parsing of the XML document and returns when the full capabilities document has been parsed.- Parameters:
args- optional arguments to pass to parsers of sub-elements.- Returns:
thisif parsing is successful, otherwise null.- Throws:
javax.xml.stream.XMLStreamException- if an exception occurs while attempting to read the event stream.
-
doParseEventContent
protected void doParseEventContent(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args) throws javax.xml.stream.XMLStreamException
Description copied from class:AbstractXMLEventParserParse an event's sub-elements.- Overrides:
doParseEventContentin classAbstractXMLEventParser- Parameters:
ctx- a current parser context.event- the event to parse.args- an optional list of arguments that may by used by subclasses.- Throws:
javax.xml.stream.XMLStreamException- if an exception occurs during event-stream reading.
-
doParseEventAttributes
protected void doParseEventAttributes(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args)
Description copied from class:AbstractXMLEventParserParse an event's attributes.- Overrides:
doParseEventAttributesin classAbstractXMLEventParser- Parameters:
ctx- a current parser context.event- the event to parse.args- an optional list of arguments that may by used by subclasses.
-
getParserContext
protected XMLEventParserContext getParserContext()
-
getServiceInformation
public OGCServiceInformation getServiceInformation()
Returns the document's service information.- Returns:
- the document's service information.
-
setServiceInformation
protected void setServiceInformation(OGCServiceInformation serviceInformation)
-
setCapabilityInformation
protected void setCapabilityInformation(OGCCapabilityInformation capabilityInformation)
-
getCapabilityInformation
public OGCCapabilityInformation getCapabilityInformation()
Returns the document's capability information.- Returns:
- the document's capability information.
-
getVersion
public java.lang.String getVersion()
Returns the document's version number.- Returns:
- the document's version number.
-
setVersion
protected void setVersion(java.lang.String version)
-
getUpdateSequence
public java.lang.String getUpdateSequence()
Returns the document's update sequence.- Returns:
- the document's update sequence.
-
setUpdateSequence
protected void setUpdateSequence(java.lang.String updateSequence)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-