Package com.vividsolutions.wms
Class AbstractParser
- java.lang.Object
-
- com.vividsolutions.wms.AbstractParser
-
- All Implemented Interfaces:
IParser
- Direct Known Subclasses:
ParserWMS1_0,ParserWMS1_1,ParserWMS1_3
public abstract class AbstractParser extends Object implements IParser
Pulls WMS objects out of the XML- Author:
- Chris Hodgson chodgson@refractions.net, Uwe Dalluege uwe.dalluege@rzcn.haw-hamburg.de, Michael Michaud m.michael.michaud@orange.fr
-
-
Constructor Summary
Constructors Constructor Description AbstractParser()Creates a Parser for dealing with WMS XML.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddSRSNode(Node n, List<String> srsList)protected BoundingBoxboundingBoxFromNode(Node n)protected voidcheckCapabilities(Document doc)BoundingBoxexGeographicBoundingBoxFromNode(Node n)doublegetCoord(String text)Coordinates in subelements westBoundLongitude, southBoundLongitude...doublegetCoord(String name, NamedNodeMap nm)Coordinates in attributes minx, miny, maxx, maxyprotected LinkedList<String>getFormatList(Document doc)protected LinkedList<String>getInfoFormats(Document doc)protected abstract StringgetRootPath()protected abstract StringgetSRSName()protected StringgetTitle(Document doc)protected StringgetTitlePath()protected BoundingBoxlatLonBoundingBoxFromNode(Node n)CapabilitiesparseCapabilities(WMService service, InputStream inStream)Parses the WMT_MS_Capabilities XML from the given InputStream into a Capabilities object.protected abstract CapabilitiesparseCapabilities(WMService service, Document doc)MapLayerwmsLayerFromNode(Node layerNode)Traverses the DOM tree underneath the specified Node and generates a corresponding WMSLayer object tree.
-
-
-
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.- Specified by:
parseCapabilitiesin interfaceIParser- Parameters:
service- the WMService from which this MapDescriptor is derivedinStream- the inputStream containing the WMT_MS_Capabilities XML to parse- Returns:
- the MapDescriptor object created from the specified XML InputStream
- Throws:
IOException
-
getRootPath
protected abstract String getRootPath()
-
checkCapabilities
protected void checkCapabilities(Document doc) throws IOException
- Throws:
IOException
-
parseCapabilities
protected abstract Capabilities parseCapabilities(WMService service, Document doc) throws IOException
- Throws:
IOException
-
getTitlePath
protected String getTitlePath()
-
getTitle
protected String getTitle(Document doc) throws IOException
- Throws:
IOException
-
getFormatList
protected LinkedList<String> getFormatList(Document doc) throws IOException
- Throws:
IOException
-
getInfoFormats
protected LinkedList<String> getInfoFormats(Document doc)
-
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 aXML element - Returns:
- a WMSLayer with complete subLayer tree that corresponds to the DOM Node provided
-
boundingBoxFromNode
protected BoundingBox boundingBoxFromNode(Node n) throws Exception
- Throws:
Exception
-
latLonBoundingBoxFromNode
protected BoundingBox latLonBoundingBoxFromNode(Node n) throws Exception
- Throws:
Exception
-
exGeographicBoundingBoxFromNode
public BoundingBox exGeographicBoundingBoxFromNode(Node n) throws Exception
- Throws:
Exception
-
getCoord
public double getCoord(String name, NamedNodeMap nm) throws Exception
Coordinates in attributes minx, miny, maxx, maxy- Throws:
Exception
-
getCoord
public double getCoord(String text) throws Exception
Coordinates in subelements westBoundLongitude, southBoundLongitude...- Throws:
Exception
-
getSRSName
protected abstract String getSRSName()
-
-