Class Parser


  • public class Parser
    extends Object
    Pulls WMS objects out of the XML
    Author:
    Chris Hodgson chodgson@refractions.net
    • Constructor Detail

      • Parser

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

      • parseCapabilities

        public Capabilities parseCapabilities​(WMService service,
                                              InputStream inStream)
                                       throws 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:
        IOException
      • wmsLayerFromNode

        public MapLayer wmsLayerFromNode​(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​(Node n)
                                        throws 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:
        Exception