001: //=============================================================================
002: //=== Copyright (C) 2001-2007 Food and Agriculture Organization of the
003: //=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
004: //=== and United Nations Environment Programme (UNEP)
005: //===
006: //=== This program is free software; you can redistribute it and/or modify
007: //=== it under the terms of the GNU General Public License as published by
008: //=== the Free Software Foundation; either version 2 of the License, or (at
009: //=== your option) any later version.
010: //===
011: //=== This program is distributed in the hope that it will be useful, but
012: //=== WITHOUT ANY WARRANTY; without even the implied warranty of
013: //=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: //=== General Public License for more details.
015: //===
016: //=== You should have received a copy of the GNU General Public License
017: //=== along with this program; if not, write to the Free Software
018: //=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
019: //===
020: //=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
021: //=== Rome - Italy. email: geonetwork@osgeo.org
022: //==============================================================================
023:
024: package org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.impl;
025:
026: import org.jdom.Element;
027: import org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.type.WMSCapability;
028: import org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.type.WMSLayer;
029: import org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.type.WMSRequest;
030:
031: /**
032: * @author ETj
033: */
034: public class WMSCapabilityImpl implements WMSCapability {
035: private WMSRequest _request = null;
036: // private WMSException _exception;
037: // private List<WMSExtendedCapabilities> _extendedCapabilities = new ArrayList<WMSExtendedCapabilities>();
038: private WMSLayer _layer = null; // Layer 0..1
039:
040: private WMSCapabilityImpl() {
041: }
042:
043: public static WMSCapability newInstance() {
044: return new WMSCapabilityImpl();
045: }
046:
047: public static WMSCapability parse(Element eCapability) {
048: WMSCapabilityImpl ci = new WMSCapabilityImpl();
049:
050: ci.setRequest(WMSFactory.parseRequest(eCapability
051: .getChild("Request")));
052: ci.setLayer(WMSFactory
053: .parseLayer(eCapability.getChild("Layer")));
054:
055: return ci;
056: }
057:
058: /**
059: * Sets Request
060: */
061: public void setRequest(WMSRequest request) {
062: _request = request;
063: }
064:
065: /**
066: * Returns Request
067: */
068: public WMSRequest getRequest() {
069: return _request;
070: }
071:
072: //
073: // /**
074: // * Sets Exception
075: // *
076: // * @param Exception a WMSException
077: // */
078: // public void setException(WMSException exception)
079: // {
080: // _exception = exception;
081: // }
082: //
083: // /**
084: // * Returns Exception
085: // *
086: // * @return a WMSException
087: // */
088: // public WMSException getException()
089: // {
090: // return _exception;
091: // }
092: //
093: // /**
094: // * Sets ExtendedCapabilities
095: // *
096: // * @param ExtendedCapabilitiesa List<WMSExtendedCapabilities>
097: // */
098: // public void setExtendedCapabilities(List<WMSExtendedCapabilities> extendedCapabilities)
099: // {
100: // _extendedCapabilities = extendedCapabilities;
101: // }
102: //
103: // /**
104: // * Returns ExtendedCapabilities
105: // *
106: // * @return a List<WMSExtendedCapabilities>
107: // */
108: // public List<WMSExtendedCapabilities> getExtendedCapabilities()
109: // {
110: // return _extendedCapabilities;
111: // }
112:
113: public void setLayer(WMSLayer layer) {
114: _layer = layer;
115: }
116:
117: public WMSLayer getLayer() {
118: return _layer;
119: }
120:
121: }
|