com.vividsolutions.wms
Class Parser

java.lang.Object
  extended by com.vividsolutions.wms.Parser

public class Parser
extends java.lang.Object

Pulls WMS objects out of the XML

Author:
Chris Hodgson chodgson@refractions.net

Constructor Summary
Parser()
          Creates a Parser for dealing with WMS XML.
 
Method Summary
 BoundingBox boundingBoxFromNode(org.w3c.dom.Node n)
          Creates a new BoundingBox object based on the DOM Node given.
 Capabilities parseCapabilities(WMService service, java.io.InputStream inStream)
          Parses the WMT_MS_Capabilities XML from the given InputStream into a Capabilities object.
 MapLayer wmsLayerFromNode(org.w3c.dom.Node layerNode)
          Traverses the DOM tree underneath the specified Node and generates a corresponding WMSLayer object tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Creates a Parser for dealing with WMS XML.

Method Detail

parseCapabilities

public Capabilities parseCapabilities(WMService service,
                                      java.io.InputStream inStream)
                               throws java.io.IOException
Parses the WMT_MS_Capabilities XML from the given InputStream into a Capabilities object.

Parameters:
service - the WMService from which this MapDescriptor is derived
inStream - the inputStream containing the WMT_MS_Capabilities XML to parse
Returns:
the MapDescriptor object created from the specified XML InputStream
Throws:
java.io.IOException

wmsLayerFromNode

public MapLayer wmsLayerFromNode(org.w3c.dom.Node layerNode)
Traverses the DOM tree underneath the specified Node and generates a corresponding WMSLayer object tree. The returned WMSLayer will be set to have the specified parent.

Parameters:
layerNode - a DOM Node which is a XML element
Returns:
a WMSLayer with complete subLayer tree that corresponds to the DOM Node provided

boundingBoxFromNode

public BoundingBox boundingBoxFromNode(org.w3c.dom.Node n)
                                throws java.lang.Exception
Creates a new BoundingBox object based on the DOM Node given.

Parameters:
n - the DOM Node to create the Bounding box from, must be either a LatLonBoundingBox element or a BoundingBox element
Returns:
a new BoundingBox object based on the DOM Node provided
Throws:
java.lang.Exception