Revision 34026 branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/WFSFeature.java
WFSFeature.java | ||
---|---|---|
73 | 73 |
/** |
74 | 74 |
* @author Jorge Piera Llodr? (piera_jor@gva.es) |
75 | 75 |
*/ |
76 |
public class WFSFeature { |
|
77 |
private String name = null; |
|
78 |
private String title = null; |
|
79 |
private String _abstract = null; |
|
80 |
private Vector srs = new Vector(); |
|
81 |
private BoundaryBox latLonBbox = null; |
|
82 |
private Hashtable bBoxes = new Hashtable(); |
|
83 |
private Vector fields = new Vector(); |
|
84 |
private Vector keywords = new Vector(); |
|
85 |
private XMLNameSpace namespace = null; |
|
86 |
|
|
87 |
public WFSFeature(){ |
|
88 |
|
|
89 |
} |
|
90 |
|
|
91 |
public WFSFeature(String name){ |
|
92 |
this.name = name; |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* @return Returns the fields. |
|
97 |
*/ |
|
98 |
public Vector getFields() { |
|
99 |
return fields; |
|
100 |
} |
|
101 |
/** |
|
102 |
* @param fields The fields to set. |
|
103 |
*/ |
|
104 |
public void setFields(Vector fields) { |
|
105 |
this.fields = fields; |
|
106 |
} |
|
107 |
/** |
|
108 |
* @return Returns the _abstract. |
|
109 |
*/ |
|
110 |
public String getAbstract() { |
|
111 |
return _abstract; |
|
112 |
} |
|
113 |
/** |
|
114 |
* @param _abstract The _abstract to set. |
|
115 |
*/ |
|
116 |
public void setAbstract(String _abstract) { |
|
117 |
this._abstract = _abstract; |
|
118 |
} |
|
119 |
|
|
120 |
/** |
|
121 |
* @return Returns the name. |
|
122 |
*/ |
|
123 |
public String getName() { |
|
124 |
return name; |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* @param name The name to set. |
|
129 |
*/ |
|
130 |
public void setName(String name) { |
|
131 |
this.name = name; |
|
132 |
} |
|
133 |
|
|
134 |
/** |
|
135 |
* @return Returns the title. |
|
136 |
*/ |
|
137 |
public String getTitle() { |
|
138 |
if ((title == null) || |
|
139 |
(title.equals(""))){ |
|
140 |
return name; |
|
141 |
} |
|
142 |
return title; |
|
143 |
} |
|
144 |
|
|
145 |
/** |
|
146 |
* @param title The title to set. |
|
147 |
*/ |
|
148 |
public void setTitle(String title) { |
|
149 |
this.title = title; |
|
150 |
} |
|
151 |
|
|
152 |
/** |
|
153 |
* @return Returns the latLonBbox. |
|
154 |
*/ |
|
155 |
public BoundaryBox getLatLonBbox() { |
|
156 |
return latLonBbox; |
|
157 |
} |
|
158 |
/** |
|
159 |
* @param latLonBbox The latLonBbox to set. |
|
160 |
*/ |
|
161 |
public void setLatLonBbox(BoundaryBox latLonBbox) { |
|
162 |
this.latLonBbox = latLonBbox; |
|
163 |
} |
|
164 |
/** |
|
165 |
* @return Returns the keywords. |
|
166 |
*/ |
|
167 |
public Vector getKeywords() { |
|
168 |
return keywords; |
|
169 |
} |
|
170 |
|
|
171 |
public void addKeyword(String keyword){ |
|
172 |
keywords.add(keyword); |
|
173 |
} |
|
174 |
/** |
|
175 |
* @return Returns the srs. |
|
176 |
*/ |
|
177 |
public Vector getSrs() { |
|
178 |
return srs; |
|
179 |
} |
|
180 |
|
|
181 |
public void addSRS(String key){ |
|
182 |
if (!this.srs.contains(key)) |
|
183 |
srs.add(key); |
|
184 |
} |
|
185 |
|
|
186 |
/** |
|
76 |
public class WFSFeature extends WFSFeatureField { |
|
77 |
private String localName = null; |
|
78 |
private String title = null; |
|
79 |
private String _abstract = null; |
|
80 |
private Vector srs = new Vector(); |
|
81 |
private String defaultSRS = null; |
|
82 |
private BoundaryBox latLonBbox = null; |
|
83 |
private Hashtable bBoxes = new Hashtable(); |
|
84 |
private Vector keywords = new Vector(); |
|
85 |
private XMLNameSpace namespace = null; |
|
86 |
private WFSServiceInformation serviceInformation; |
|
87 |
private boolean isCompleted = false; |
|
88 |
|
|
89 |
protected WFSFeature(WFSServiceInformation serviceInformation){ |
|
90 |
super(); |
|
91 |
this.serviceInformation = serviceInformation; |
|
92 |
} |
|
93 |
|
|
94 |
protected WFSFeature(WFSServiceInformation serviceInformation, String name){ |
|
95 |
super(); |
|
96 |
this.serviceInformation = serviceInformation; |
|
97 |
setName(name); |
|
98 |
} |
|
99 |
|
|
100 |
/** |
|
101 |
* @return Returns the _abstract. |
|
102 |
*/ |
|
103 |
public String getAbstract() { |
|
104 |
return _abstract; |
|
105 |
} |
|
106 |
/** |
|
107 |
* @param _abstract The _abstract to set. |
|
108 |
*/ |
|
109 |
public void setAbstract(String _abstract) { |
|
110 |
this._abstract = _abstract; |
|
111 |
} |
|
112 |
|
|
113 |
/** |
|
114 |
* @param name The name to set. |
|
115 |
*/ |
|
116 |
public void setName(String name) { |
|
117 |
this.name = name; |
|
118 |
int index = name.indexOf(":"); |
|
119 |
if (index > 0){ |
|
120 |
String prefix = name.substring(0, index); |
|
121 |
localName = name.substring(index+1, name.length()); |
|
122 |
String nameSpace = serviceInformation.getNamespace(prefix); |
|
123 |
this.setNamespace(new XMLNameSpace(prefix, nameSpace)); |
|
124 |
} |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* @return Returns the title. |
|
129 |
*/ |
|
130 |
public String getTitle() { |
|
131 |
if ((title == null) || |
|
132 |
(title.equals(""))){ |
|
133 |
return name; |
|
134 |
} |
|
135 |
return title; |
|
136 |
} |
|
137 |
|
|
138 |
/** |
|
139 |
* @param title The title to set. |
|
140 |
*/ |
|
141 |
public void setTitle(String title) { |
|
142 |
this.title = title; |
|
143 |
} |
|
144 |
|
|
145 |
/** |
|
146 |
* @return Returns the latLonBbox. |
|
147 |
*/ |
|
148 |
public BoundaryBox getLatLonBbox() { |
|
149 |
return latLonBbox; |
|
150 |
} |
|
151 |
/** |
|
152 |
* @param latLonBbox The latLonBbox to set. |
|
153 |
*/ |
|
154 |
public void setLatLonBbox(BoundaryBox latLonBbox) { |
|
155 |
this.latLonBbox = latLonBbox; |
|
156 |
} |
|
157 |
/** |
|
158 |
* @return Returns the keywords. |
|
159 |
*/ |
|
160 |
public Vector getKeywords() { |
|
161 |
return keywords; |
|
162 |
} |
|
163 |
|
|
164 |
public void addKeyword(String keyword){ |
|
165 |
keywords.add(keyword); |
|
166 |
} |
|
167 |
/** |
|
168 |
* @return Returns the srs. |
|
169 |
*/ |
|
170 |
public Vector getSrs() { |
|
171 |
return srs; |
|
172 |
} |
|
173 |
|
|
174 |
public void addSRS(String key){ |
|
175 |
if (!this.srs.contains(key)){ |
|
176 |
srs.add(key); |
|
177 |
} |
|
178 |
if (defaultSRS == null){ |
|
179 |
defaultSRS = key; |
|
180 |
} |
|
181 |
} |
|
182 |
|
|
183 |
/** |
|
187 | 184 |
* <p>Adds a bbox to the Bboxes vector</p> |
188 | 185 |
* @param bbox |
189 | 186 |
*/ |
190 | 187 |
public void addBBox(BoundaryBox bbox) { |
191 | 188 |
bBoxes.put(bbox.getSrs(), bbox); |
192 | 189 |
} |
193 |
|
|
190 |
|
|
194 | 191 |
/** |
195 | 192 |
* <p>returns the bbox with that id in the Bboxes vector</p> |
196 | 193 |
* @param id |
197 | 194 |
*/ |
198 | 195 |
public BoundaryBox getBbox(String id) { |
199 |
return (BoundaryBox)bBoxes.get(id);
|
|
196 |
return (BoundaryBox)bBoxes.get(id);
|
|
200 | 197 |
} |
201 |
/** |
|
202 |
* @return Returns the namespace. |
|
203 |
*/ |
|
204 |
public XMLNameSpace getNamespace() { |
|
205 |
return namespace; |
|
206 |
} |
|
207 |
/** |
|
208 |
* @param namespace The namespace to set. |
|
209 |
*/ |
|
210 |
public void setNamespace(XMLNameSpace namespace) { |
|
211 |
this.namespace = namespace; |
|
212 |
} |
|
213 |
|
|
198 |
/** |
|
199 |
* @return Returns the namespace. |
|
200 |
*/ |
|
201 |
public XMLNameSpace getNamespace() { |
|
202 |
return namespace; |
|
203 |
} |
|
204 |
/** |
|
205 |
* @param namespace The namespace to set. |
|
206 |
*/ |
|
207 |
public void setNamespace(XMLNameSpace namespace) { |
|
208 |
this.namespace = namespace; |
|
209 |
} |
|
210 |
|
|
211 |
/** |
|
212 |
* @return the localName |
|
213 |
*/ |
|
214 |
public String getLocalName() { |
|
215 |
return localName; |
|
216 |
} |
|
217 |
|
|
218 |
|
|
219 |
/** |
|
220 |
* @return the isCompleted |
|
221 |
*/ |
|
222 |
public boolean isCompleted() { |
|
223 |
return isCompleted; |
|
224 |
} |
|
225 |
|
|
226 |
/** |
|
227 |
* @param isCompleted the isCompleted to set |
|
228 |
*/ |
|
229 |
public void setCompleted(boolean isCompleted) { |
|
230 |
this.isCompleted = isCompleted; |
|
231 |
} |
|
232 |
|
|
233 |
/** |
|
234 |
* @return the defaultSRS |
|
235 |
*/ |
|
236 |
public String getDefaultSRS() { |
|
237 |
return defaultSRS; |
|
238 |
} |
|
239 |
|
|
240 |
|
|
241 |
/** |
|
242 |
* @param defaultSRS the defaultSRS to set |
|
243 |
*/ |
|
244 |
public void setDefaultSRS(String defaultSRS) { |
|
245 |
this.defaultSRS = defaultSRS; |
|
246 |
addSRS(defaultSRS); |
|
247 |
} |
|
214 | 248 |
} |
Also available in: Unified diff