Class AbstractWMSXMLEncoder
- java.lang.Object
-
- com.supermap.services.wms.AbstractWMSXMLEncoder
-
- All Implemented Interfaces:
- WMSXMLEncoder
- Direct Known Subclasses:
- WMSXMLEncoder111
public abstract class AbstractWMSXMLEncoder extends java.lang.Object implements WMSXMLEncoder
Abstract WMS XML document encoder.
Realize general WMS XML encoding method.
-
-
Field Summary
Fields Modifier and Type Field and Description protected java.lang.StringcapabilitiesDTDOrXSDDTD or XSD document address which is used in the XML document returned by the GetCapabilities operation.protected static java.lang.StringCRSprotected java.lang.StringexceptionDTDOrXSDDTD or XSD document address of the WMS exception XML document.protected java.lang.StringfeatureDTDOrXSDDTD or XSD document address which is used in the XML document returned by the GetFeatureInfo operation.protected static java.lang.StringOGC_NAMESPACE_URLThe name space of WMS 1.3.0 Service Exception XML document(xmlns).protected java.lang.StringproviderUrlOnline resource URL.protected static java.lang.StringSRSprotected static java.lang.StringWMS_NAMESPACE_URLThe name space of WMS 1.3.0 Capabilities XML document(xmlns).
-
Constructor Summary
Constructors Modifier Constructor and Description protectedAbstractWMSXMLEncoder()The Constructor.protectedAbstractWMSXMLEncoder(java.util.Map<java.lang.String,java.lang.String> params)Constructs the AbstractWMSXMLEncoder object according to a series of document directories.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.StringgetCapabilitiesDTDOrXSD()Get the DTD or XSD document address of the Capabilities XML document.java.lang.StringgetExceptionDTDOrXSD()Get the DTD or XSD document address of the exception information XML document.java.lang.StringgetFeatureDTDOrXSD()Get DTD or XSD document address in the XML document of the GetFeatureInfo operation response.voidsetCapabilitiesDTDOrXSD(java.lang.String path)Set the DTD or XSD document address of the Capabilities XML document.voidsetExceptionDTDOrXSD(java.lang.String url)Set the DTD or XSD document address of the exception XML document.voidsetFeatureDTDOrXSD(java.lang.String url)Set DTD or XSD document address in the XML document of the GetFeatureInfo operation response.voidsetProviderUrl(java.lang.String providerUrl)Set Online resource URL.protected abstract voidwriteCRSNode(Node layerNode, WMSLayer layer)Add coordinate system node(SRS or CRS) to the Layer node.protected abstract NodewriteLayer(Node fatherNode, WMSLayer wmsLayer, Rectangle2D mapBounds, WMSCapabilities capabilities)Add Layer sub node to the Layer parent node.protected abstract voidwriteLayerStyle(Node layerNode, UserStyleElement wmsLayerStyle)Add layer style node in the Layer node.protected abstract NodewriteRootNode(Node doc)Creates the root node of WMS XML document.protected abstract voidwriteServiceNameNode(Node serviceNode)Add Name node in Service node.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.supermap.services.wms.WMSXMLEncoder
encode, encode, encode, getVersion
-
-
-
-
Field Detail
-
SRS
protected static final java.lang.String SRS
-
CRS
protected static final java.lang.String CRS
-
OGC_NAMESPACE_URL
protected static final java.lang.String OGC_NAMESPACE_URL
The name space of WMS 1.3.0 Service Exception XML document(xmlns).
The default is “http://www.opengis.net/ogc”.
-
WMS_NAMESPACE_URL
protected static final java.lang.String WMS_NAMESPACE_URL
The name space of WMS 1.3.0 Capabilities XML document(xmlns).
The default is “http://www.opengis.net/wms”.
-
capabilitiesDTDOrXSD
protected java.lang.String capabilitiesDTDOrXSD
DTD or XSD document address which is used in the XML document returned by the GetCapabilities operation.
-
providerUrl
protected java.lang.String providerUrl
Online resource URL.
The URL is a URL prefix, which is an opaque string, including protocol, host name, port number (optional), path, English mark ("?"), and one or more parameters defined by server (optional), where the parameter uses"&" at the end.
In the XML document of WMS, the field value is recorded in the xlink:href property of the OnlineResource element.
-
exceptionDTDOrXSD
protected java.lang.String exceptionDTDOrXSD
DTD or XSD document address of the WMS exception XML document.
-
featureDTDOrXSD
protected java.lang.String featureDTDOrXSD
DTD or XSD document address which is used in the XML document returned by the GetFeatureInfo operation.
-
-
Constructor Detail
-
AbstractWMSXMLEncoder
protected AbstractWMSXMLEncoder()
The Constructor.
-
AbstractWMSXMLEncoder
protected AbstractWMSXMLEncoder(java.util.Map<java.lang.String,java.lang.String> params)
Constructs the AbstractWMSXMLEncoder object according to a series of document directories.- Parameters:
params- The parameter is a Map mapping. The mapping key value is CapabilitiesDTDOrXSD, providerUrl, exceptionDTDOrXSD and featureDTDOrXSD, and the key value is relevant document URL.
-
-
Method Detail
-
setProviderUrl
public final void setProviderUrl(java.lang.String providerUrl)
Set Online resource URL.
The URL is a URL prefix, which is an opaque string, including protocol, host name, port number (optional), path, English mark ("?"), and one or more parameters defined by server (optional), where the parameter uses"&" at the end.
In the XML document of WMS, the field value is recorded in the xlink:href property of the OnlineResource element.
-
- If the parameter providerUrl ends with “?” or “&”, then the online resource URL is set to this parameter.
- If the parameter providerUrl doesn't end with “?” or “&” and there is no “?” in the parameter, then add “?” to the providerUrl parameter then set it to the online resource URL.
- If the parameter providerUrl doesn't end with “?” or “&” and there is “?” in the parameter, then add “&” to the providerUrl parameter then set it to the online resource URL.
-
- Specified by:
setProviderUrlin interfaceWMSXMLEncoder- Parameters:
providerUrl- online resource URL.
-
setCapabilitiesDTDOrXSD
public final void setCapabilitiesDTDOrXSD(java.lang.String path)
Set the DTD or XSD document address of the Capabilities XML document.- Specified by:
setCapabilitiesDTDOrXSDin interfaceWMSXMLEncoder- Parameters:
path- the DTD or XSD document address.
-
setExceptionDTDOrXSD
public final void setExceptionDTDOrXSD(java.lang.String url)
Set the DTD or XSD document address of the exception XML document.- Specified by:
setExceptionDTDOrXSDin interfaceWMSXMLEncoder- Parameters:
url- the DTD or XSD document address.
-
setFeatureDTDOrXSD
public final void setFeatureDTDOrXSD(java.lang.String url)
Set DTD or XSD document address in the XML document of the GetFeatureInfo operation response.- Specified by:
setFeatureDTDOrXSDin interfaceWMSXMLEncoder- Parameters:
url- the DTD or XSD document address.
-
getCapabilitiesDTDOrXSD
public final java.lang.String getCapabilitiesDTDOrXSD()
Get the DTD or XSD document address of the Capabilities XML document.- Specified by:
getCapabilitiesDTDOrXSDin interfaceWMSXMLEncoder- Returns:
- the DTD or XSD document address.
-
getExceptionDTDOrXSD
public final java.lang.String getExceptionDTDOrXSD()
Get the DTD or XSD document address of the exception information XML document.- Specified by:
getExceptionDTDOrXSDin interfaceWMSXMLEncoder- Returns:
- the DTD or XSD document address.
-
getFeatureDTDOrXSD
public final java.lang.String getFeatureDTDOrXSD()
Get DTD or XSD document address in the XML document of the GetFeatureInfo operation response.- Specified by:
getFeatureDTDOrXSDin interfaceWMSXMLEncoder- Returns:
- the DTD or XSD document address.
-
writeRootNode
protected abstract Node writeRootNode(Node doc)
Creates the root node of WMS XML document. The root node is relevant with WMS, such as the WMT_MS_Capabilities node in the WMS 1.1.1 Capabilities XML document.- Parameters:
doc- XML document root node, such as “<?xml version="1.0" encoding="UTF-8"?>”- Returns:
- WMS XML document root node.
-
writeLayer
protected abstract Node writeLayer(Node fatherNode, WMSLayer wmsLayer, Rectangle2D mapBounds, WMSCapabilities capabilities)
Add Layer sub node to the Layer parent node.- Parameters:
fatherNode- the Layer parent node.wmsLayer- WMS layer.mapBounds- the geographical range of the map.- Returns:
- Level 1 node under the Layer parent node.
-
writeServiceNameNode
protected abstract void writeServiceNameNode(Node serviceNode)
Add Name node in Service node. The Name node is used to describe the service name.- Parameters:
serviceNode- Service node.
-
writeCRSNode
protected abstract void writeCRSNode(Node layerNode, WMSLayer layer)
Add coordinate system node(SRS or CRS) to the Layer node.- Parameters:
layerNode- Layer node.
-
writeLayerStyle
protected abstract void writeLayerStyle(Node layerNode, UserStyleElement wmsLayerStyle)
Add layer style node in the Layer node.- Parameters:
layerNode- Layer node.