NASA World Wind

gov.nasa.worldwind.ogc
Class OGCCapabilities

java.lang.Object
  extended by gov.nasa.worldwind.util.xml.AbstractXMLEventParser
      extended by 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
protected  QName CAPABILITY
           
protected  OGCCapabilityInformation capabilityInformation
           
protected  XMLEventReader eventReader
           
protected  XMLEventParserContext parserContext
           
protected  QName SERVICE
           
protected  OGCServiceInformation serviceInformation
           
protected  QName UPDATE_SEQUENCE
           
protected  String updateSequence
           
protected  String version
           
protected  QName VERSION
           
 
Fields inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
CHARACTERS_CONTENT, fields, namespaceURI, parent
 
Constructor Summary
OGCCapabilities(String namespaceURI, Object docSource)
          Create a new capabilities parser.
 
Method Summary
 XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
          Create a parser for a specified event.
protected  XMLEventParserContext createParserContext(XMLEventReader reader)
           
protected  XMLEventReader createReader(Object docSource)
           
protected  void doParseEventAttributes(XMLEventParserContext ctx, XMLEvent event, Object... args)
          Parse an event's attributes.
protected  void doParseEventContent(XMLEventParserContext ctx, XMLEvent event, Object... args)
          Parse an event's sub-elements.
 OGCCapabilityInformation getCapabilityInformation()
          Returns the document's capability information.
abstract  String getDefaultNamespaceURI()
          Returns the default namespace URI.
protected  XMLEventParserContext getParserContext()
           
 OGCServiceInformation getServiceInformation()
          Returns the document's service information.
 String getUpdateSequence()
          Returns the document's update sequence.
 String getVersion()
          Returns the document's version number.
abstract  boolean isRootElementName(QName name)
          Determines whether a specified element name is the root element name of the schema.
 OGCCapabilities parse(Object... args)
          Starts document parsing.
protected  void setCapabilityInformation(OGCCapabilityInformation capabilityInformation)
           
protected  void setServiceInformation(OGCServiceInformation serviceInformation)
           
protected  void setUpdateSequence(String updateSequence)
           
protected  void setVersion(String version)
           
 String toString()
           
 
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, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CAPABILITY

protected QName CAPABILITY

capabilityInformation

protected OGCCapabilityInformation capabilityInformation

eventReader

protected XMLEventReader eventReader

parserContext

protected XMLEventParserContext parserContext

SERVICE

protected QName SERVICE

serviceInformation

protected OGCServiceInformation serviceInformation

UPDATE_SEQUENCE

protected QName UPDATE_SEQUENCE

updateSequence

protected String updateSequence

version

protected String version

VERSION

protected QName VERSION
Constructor Detail

OGCCapabilities

public OGCCapabilities(String namespaceURI,
                       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 by WWXML.openEventReader(Object).
Throws:
IllegalArgumentException - if the document source is null.
Method Detail

allocate

public XMLEventParser allocate(XMLEventParserContext ctx,
                               XMLEvent event)
Create a parser for a specified event.

Overrides:
allocate in class AbstractXMLEventParser
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.

createParserContext

protected XMLEventParserContext createParserContext(XMLEventReader reader)

createReader

protected XMLEventReader createReader(Object docSource)

doParseEventAttributes

protected void doParseEventAttributes(XMLEventParserContext ctx,
                                      XMLEvent event,
                                      Object... args)
Description copied from class: AbstractXMLEventParser
Parse an event's attributes.

Overrides:
doParseEventAttributes in class AbstractXMLEventParser
Parameters:
ctx - a current parser context.
event - the event to parse.
args - an optional list of arguments that may by used by subclasses.

doParseEventContent

protected void doParseEventContent(XMLEventParserContext ctx,
                                   XMLEvent event,
                                   Object... args)
                            throws XMLStreamException
Description copied from class: AbstractXMLEventParser
Parse an event's sub-elements.

Overrides:
doParseEventContent in class AbstractXMLEventParser
Parameters:
ctx - a current parser context.
event - the event to parse.
args - an optional list of arguments that may by used by subclasses.
Throws:
XMLStreamException - if an exception occurs during event-stream reading.

getCapabilityInformation

public OGCCapabilityInformation getCapabilityInformation()
Returns the document's capability information.

Returns:
the document's capability information.

getDefaultNamespaceURI

public abstract 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.

getParserContext

protected XMLEventParserContext getParserContext()

getServiceInformation

public OGCServiceInformation getServiceInformation()
Returns the document's service information.

Returns:
the document's service information.

getUpdateSequence

public String getUpdateSequence()
Returns the document's update sequence.

Returns:
the document's update sequence.

getVersion

public String getVersion()
Returns the document's version number.

Returns:
the document's version number.

isRootElementName

public abstract boolean isRootElementName(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.

parse

public OGCCapabilities parse(Object... args)
                      throws 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:
this if parsing is successful, otherwise null.
Throws:
XMLStreamException - if an exception occurs while attempting to read the event stream.

setCapabilityInformation

protected void setCapabilityInformation(OGCCapabilityInformation capabilityInformation)

setServiceInformation

protected void setServiceInformation(OGCServiceInformation serviceInformation)

setUpdateSequence

protected void setUpdateSequence(String updateSequence)

setVersion

protected void setVersion(String version)

toString

public String toString()
Overrides:
toString in class Object

NASA World Wind