root / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wms / WMSDimension.java @ 38579
History | View | Annotate | Download (3.74 KB)
1 |
|
---|---|
2 |
package org.gvsig.remoteclient.wms; |
3 |
|
4 |
import java.io.IOException; |
5 |
|
6 |
import org.kxml2.io.KXmlParser; |
7 |
import org.xmlpull.v1.XmlPullParserException; |
8 |
|
9 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
10 |
|
11 |
/**
|
12 |
* <p></p>
|
13 |
*
|
14 |
*/
|
15 |
public class WMSDimension { |
16 |
|
17 |
private String name; |
18 |
private String units; |
19 |
private String unitSymbol; |
20 |
/**
|
21 |
* Declares what value would be used along this dimension if a Web
|
22 |
* request omits a value for this dimension.
|
23 |
*/
|
24 |
private String dimDefaultValue; |
25 |
/**
|
26 |
* Indicates that the request may include multiple values or
|
27 |
* (if it is null or zero) have to include <b>only<b/> single
|
28 |
* value for this dimension.
|
29 |
*/
|
30 |
private String multipleValues; |
31 |
/**
|
32 |
* Indicates that the server will round off inexact dimension values
|
33 |
* to the nearest valid value, or (if it is null or zero) it will not.
|
34 |
*/
|
35 |
private String nearestValues; |
36 |
/**
|
37 |
* Indicates that temporal data are normally kept current and that the
|
38 |
* request parameter TIME <b>may</b> include the keyword 'current'
|
39 |
* instead of an ending value.
|
40 |
*/
|
41 |
private String current; |
42 |
/**
|
43 |
* cotains the expression for this dimension's extent.
|
44 |
*/
|
45 |
private String extentExpression; |
46 |
private String extDefaultValue; |
47 |
|
48 |
private String dimensionExpression; |
49 |
|
50 |
public String getName() { |
51 |
return name;
|
52 |
} |
53 |
|
54 |
public String getUnits() { |
55 |
return units;
|
56 |
} |
57 |
|
58 |
public String getUnitSymbol() { |
59 |
return unitSymbol;
|
60 |
} |
61 |
|
62 |
/**
|
63 |
* Tells that the temporal data are normally kept current and that
|
64 |
* the request parameter TIME may include the keyword 'current'
|
65 |
* instead of an ending value.
|
66 |
*
|
67 |
* @return <b>true</b> if the server does keep the data, <b>false</b> else.
|
68 |
*/
|
69 |
public boolean allowsCurrentTime() { |
70 |
return (current!=null && !current.equals("0")); |
71 |
} |
72 |
|
73 |
|
74 |
/**
|
75 |
* Gets the value that would be used along this dimension if a Web
|
76 |
* request omits a value for the dimension.
|
77 |
*
|
78 |
* @return Returns the defaultValue.
|
79 |
*/
|
80 |
public String getDimDefaultValue() { |
81 |
return dimDefaultValue;
|
82 |
} |
83 |
|
84 |
/**
|
85 |
* Returns the extent expression as it was written in the Capabilities
|
86 |
* document.
|
87 |
* @return String
|
88 |
*/
|
89 |
public String getExtentExpression() { |
90 |
return extentExpression;
|
91 |
} |
92 |
/**
|
93 |
* @return Returns the multipleValues.
|
94 |
*/
|
95 |
public boolean allowsMultipleValues() { |
96 |
return (multipleValues!=null && !multipleValues.equals("0")); |
97 |
} |
98 |
|
99 |
|
100 |
/**
|
101 |
* @return Returns the dimensionExpression.
|
102 |
*/
|
103 |
public String getDimensionExpression() { |
104 |
return dimensionExpression;
|
105 |
} |
106 |
|
107 |
public void setDimensionExpression(String exp) { |
108 |
dimensionExpression = exp; |
109 |
} |
110 |
|
111 |
/**
|
112 |
* @return Returns the nearestValues.
|
113 |
*/
|
114 |
public boolean allowsNearestValues() { |
115 |
return (nearestValues!=null && !nearestValues.equals("0")); |
116 |
} |
117 |
|
118 |
|
119 |
/**
|
120 |
* Parses the DIMENSION tag in the WMS capabilities, filling the WMSDimension object
|
121 |
* and loading the data into memory to be easily accesed
|
122 |
*/
|
123 |
public void parse(KXmlParser parser) throws IOException, XmlPullParserException{ |
124 |
parser.require(KXmlParser.START_TAG, null, CapabilitiesTags.DIMENSION);
|
125 |
name = parser.getAttributeValue("", CapabilitiesTags.DIMENSION_NAME);
|
126 |
units = parser.getAttributeValue("", CapabilitiesTags.DIMENSION_UNITS);
|
127 |
unitSymbol = parser.getAttributeValue("", CapabilitiesTags.DIMENSION_UNIT_SYMBOL);
|
128 |
dimDefaultValue = parser.getAttributeValue("", CapabilitiesTags.DEFAULT);
|
129 |
dimensionExpression = parser.nextText(); |
130 |
} |
131 |
|
132 |
} |