svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.impl / src / main / java / org / gvsig / fmap / dal / feature / impl / DefaultFeatureAttributeDescriptor.java @ 44086
History | View | Annotate | Download (29.2 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
5 | *
|
||
6 | 42561 | jjdelcerro | * This program is free software; you can redistribute it and/or modify it under
|
7 | * the terms of the GNU General Public License as published by the Free Software
|
||
8 | * Foundation; either version 3 of the License, or (at your option) any later
|
||
9 | * version.
|
||
10 | 40559 | jjdelcerro | *
|
11 | 42561 | jjdelcerro | * This program is distributed in the hope that it will be useful, but WITHOUT
|
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
14 | * details.
|
||
15 | 40559 | jjdelcerro | *
|
16 | 42561 | jjdelcerro | * You should have received a copy of the GNU General Public License along with
|
17 | * this program; if not, write to the Free Software Foundation, Inc., 51
|
||
18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
19 | 40559 | jjdelcerro | *
|
20 | 42561 | jjdelcerro | * For any additional information, do not hesitate to contact us at info AT
|
21 | * gvsig.com, or visit our website www.gvsig.com.
|
||
22 | 40559 | jjdelcerro | */
|
23 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.feature.impl; |
24 | |||
25 | 43739 | jjdelcerro | import java.lang.ref.WeakReference; |
26 | 40435 | jjdelcerro | import java.text.DateFormat; |
27 | import java.util.HashMap; |
||
28 | import java.util.Iterator; |
||
29 | import java.util.List; |
||
30 | import java.util.Map; |
||
31 | import java.util.Map.Entry; |
||
32 | 42563 | jjdelcerro | import org.apache.commons.lang3.ArrayUtils; |
33 | 40435 | jjdelcerro | import org.cresques.cts.IProjection; |
34 | import org.gvsig.fmap.crs.CRSFactory; |
||
35 | 44022 | jjdelcerro | import org.gvsig.fmap.dal.DataStore; |
36 | 44083 | jjdelcerro | import org.gvsig.fmap.dal.DataTypes; |
37 | 40435 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
38 | 42563 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureAttributeEmulator; |
39 | 40435 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureAttributeGetter; |
40 | 43739 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureStore; |
41 | import org.gvsig.fmap.dal.feature.FeatureType; |
||
42 | 40435 | jjdelcerro | import org.gvsig.fmap.geom.Geometry; |
43 | import org.gvsig.fmap.geom.GeometryException; |
||
44 | import org.gvsig.fmap.geom.GeometryLocator; |
||
45 | import org.gvsig.fmap.geom.type.GeometryType; |
||
46 | 44077 | jjdelcerro | import org.gvsig.timesupport.Interval; |
47 | import org.gvsig.timesupport.TimeSupportLocator; |
||
48 | 40435 | jjdelcerro | import org.gvsig.tools.ToolsLocator; |
49 | import org.gvsig.tools.dataTypes.CoercionException; |
||
50 | import org.gvsig.tools.dataTypes.DataType; |
||
51 | import org.gvsig.tools.dynobject.DynField; |
||
52 | 41323 | jjdelcerro | import org.gvsig.tools.dynobject.DynField_LabelAttribute; |
53 | 42563 | jjdelcerro | import org.gvsig.tools.dynobject.DynField_v2; |
54 | 42775 | jjdelcerro | import org.gvsig.tools.dynobject.DynMethod; |
55 | 42606 | jjdelcerro | import org.gvsig.tools.dynobject.DynObject; |
56 | 40435 | jjdelcerro | import org.gvsig.tools.dynobject.DynObjectValueItem; |
57 | import org.gvsig.tools.dynobject.DynStruct; |
||
58 | 42563 | jjdelcerro | import org.gvsig.tools.dynobject.Tags; |
59 | 40435 | jjdelcerro | import org.gvsig.tools.dynobject.exception.DynFieldIsNotAContainerException; |
60 | import org.gvsig.tools.dynobject.exception.DynFieldValidateException; |
||
61 | 42775 | jjdelcerro | import org.gvsig.tools.dynobject.exception.DynMethodException; |
62 | 42563 | jjdelcerro | import org.gvsig.tools.dynobject.impl.DefaultTags; |
63 | 41212 | jjdelcerro | import org.gvsig.tools.evaluator.AbstractEvaluator; |
64 | 40435 | jjdelcerro | import org.gvsig.tools.evaluator.Evaluator; |
65 | 41212 | jjdelcerro | import org.gvsig.tools.evaluator.EvaluatorData; |
66 | import org.gvsig.tools.evaluator.EvaluatorException; |
||
67 | 40435 | jjdelcerro | import org.gvsig.tools.persistence.Persistent; |
68 | import org.gvsig.tools.persistence.PersistentState; |
||
69 | import org.gvsig.tools.persistence.exception.PersistenceException; |
||
70 | |||
71 | public class DefaultFeatureAttributeDescriptor implements |
||
72 | 42563 | jjdelcerro | FeatureAttributeDescriptor, Persistent, DynField_v2, DynField_LabelAttribute { |
73 | 40435 | jjdelcerro | |
74 | protected boolean allowNull; |
||
75 | protected DataType dataType;
|
||
76 | protected DateFormat dateFormat; |
||
77 | protected Object defaultValue; |
||
78 | protected int index; |
||
79 | protected int maximumOccurrences; |
||
80 | protected int minimumOccurrences; |
||
81 | protected int size; |
||
82 | protected String name; |
||
83 | protected Class objectClass; |
||
84 | protected int precision; |
||
85 | protected Evaluator evaluator;
|
||
86 | protected boolean primaryKey; |
||
87 | protected boolean readOnly; |
||
88 | protected IProjection SRS;
|
||
89 | protected GeometryType geomType;
|
||
90 | protected int geometryType; |
||
91 | protected int geometrySubType; |
||
92 | protected Map additionalInfo; |
||
93 | protected boolean isAutomatic; |
||
94 | 41335 | jjdelcerro | protected boolean isTime = false; |
95 | 44077 | jjdelcerro | protected Interval interval;
|
96 | 41335 | jjdelcerro | protected FeatureAttributeGetter featureAttributeGetter = null; |
97 | protected FeatureAttributeEmulator featureAttributeEmulator = null; |
||
98 | 41638 | jjdelcerro | protected boolean indexed = false; |
99 | protected boolean isIndexAscending = true; |
||
100 | protected boolean allowIndexDuplicateds = true; |
||
101 | 40435 | jjdelcerro | |
102 | 42563 | jjdelcerro | protected DynObjectValueItem[] availableValues; |
103 | protected String description; |
||
104 | protected Object minValue; |
||
105 | protected Object maxValue; |
||
106 | protected String label; |
||
107 | protected int order; |
||
108 | protected boolean hidden; |
||
109 | protected String groupName; |
||
110 | protected Tags tags = new DefaultTags(); |
||
111 | 42775 | jjdelcerro | private DynMethod availableValuesMethod;
|
112 | private DynMethod calculateMethod;
|
||
113 | 43739 | jjdelcerro | private WeakReference typeRef; |
114 | 42563 | jjdelcerro | |
115 | 43739 | jjdelcerro | protected DefaultFeatureAttributeDescriptor(FeatureType type) {
|
116 | if( type == null ) { |
||
117 | this.typeRef = null; |
||
118 | } else {
|
||
119 | this.typeRef = new WeakReference(type); |
||
120 | } |
||
121 | 40435 | jjdelcerro | this.allowNull = true; |
122 | this.dataType = null; |
||
123 | this.dateFormat = null; |
||
124 | this.defaultValue = null; |
||
125 | this.index = -1; |
||
126 | this.maximumOccurrences = 0; |
||
127 | this.minimumOccurrences = 0; |
||
128 | this.size = 0; |
||
129 | this.name = null; |
||
130 | this.objectClass = null; |
||
131 | this.precision = 0; |
||
132 | this.evaluator = null; |
||
133 | this.primaryKey = false; |
||
134 | this.readOnly = false; |
||
135 | this.SRS = null; |
||
136 | this.geometryType = Geometry.TYPES.NULL;
|
||
137 | this.geometrySubType = Geometry.SUBTYPES.UNKNOWN;
|
||
138 | this.additionalInfo = null; |
||
139 | this.isAutomatic = false; |
||
140 | 43362 | jjdelcerro | this.hidden = false; |
141 | 40435 | jjdelcerro | } |
142 | |||
143 | protected DefaultFeatureAttributeDescriptor(
|
||
144 | 43739 | jjdelcerro | DefaultFeatureAttributeDescriptor other |
145 | ) { |
||
146 | 42775 | jjdelcerro | copyFrom(other); |
147 | } |
||
148 | |||
149 | @Override
|
||
150 | public void copyFrom(DynField other1) { |
||
151 | if( !(other1 instanceof DefaultFeatureAttributeDescriptor) ) { |
||
152 | throw new IllegalArgumentException("Can't copy from a non DefaultFeatureAttributeDescriptor"); |
||
153 | } |
||
154 | DefaultFeatureAttributeDescriptor other = (DefaultFeatureAttributeDescriptor) other1; |
||
155 | 43739 | jjdelcerro | this.typeRef = other.typeRef;
|
156 | 40435 | jjdelcerro | this.allowNull = other.allowNull;
|
157 | this.dataType = other.dataType;
|
||
158 | this.dateFormat = other.dateFormat;
|
||
159 | this.defaultValue = other.defaultValue;
|
||
160 | this.index = other.index;
|
||
161 | this.maximumOccurrences = other.maximumOccurrences;
|
||
162 | this.minimumOccurrences = other.minimumOccurrences;
|
||
163 | this.size = other.size;
|
||
164 | this.name = other.name;
|
||
165 | this.objectClass = other.objectClass;
|
||
166 | this.precision = other.precision;
|
||
167 | this.evaluator = other.evaluator;
|
||
168 | this.primaryKey = other.primaryKey;
|
||
169 | this.readOnly = other.readOnly;
|
||
170 | this.SRS = other.SRS;
|
||
171 | this.geometryType = other.geometryType;
|
||
172 | this.geometrySubType = other.geometrySubType;
|
||
173 | this.geomType = other.geomType;
|
||
174 | if (other.additionalInfo != null) { |
||
175 | Iterator iter = other.additionalInfo.entrySet().iterator();
|
||
176 | Map.Entry entry;
|
||
177 | this.additionalInfo = new HashMap(); |
||
178 | while (iter.hasNext()) {
|
||
179 | entry = (Entry) iter.next(); |
||
180 | this.additionalInfo.put(entry.getKey(), entry.getValue());
|
||
181 | } |
||
182 | } else {
|
||
183 | this.additionalInfo = null; |
||
184 | } |
||
185 | this.isAutomatic = other.isAutomatic;
|
||
186 | 41335 | jjdelcerro | this.isTime = other.isTime;
|
187 | this.featureAttributeEmulator = other.featureAttributeEmulator;
|
||
188 | 41638 | jjdelcerro | this.indexed = other.indexed;
|
189 | this.isIndexAscending = other.isIndexAscending;
|
||
190 | this.allowIndexDuplicateds = other.allowIndexDuplicateds;
|
||
191 | 43362 | jjdelcerro | this.hidden = other.hidden;
|
192 | 40435 | jjdelcerro | } |
193 | 42775 | jjdelcerro | |
194 | 42561 | jjdelcerro | @Override
|
195 | 40435 | jjdelcerro | public String getDataTypeName() { |
196 | 42561 | jjdelcerro | if (this.getDataType() == null) { |
197 | 40435 | jjdelcerro | return "(unknow)"; |
198 | } |
||
199 | 42561 | jjdelcerro | return this.getDataType().getName(); |
200 | 40435 | jjdelcerro | } |
201 | |||
202 | 42561 | jjdelcerro | @Override
|
203 | 40435 | jjdelcerro | public FeatureAttributeDescriptor getCopy() {
|
204 | return new DefaultFeatureAttributeDescriptor(this); |
||
205 | } |
||
206 | |||
207 | 42561 | jjdelcerro | @Override
|
208 | 42775 | jjdelcerro | public Object clone() throws CloneNotSupportedException { |
209 | return new DefaultFeatureAttributeDescriptor(this); |
||
210 | } |
||
211 | |||
212 | @Override
|
||
213 | 40435 | jjdelcerro | public boolean allowNull() { |
214 | return allowNull;
|
||
215 | } |
||
216 | |||
217 | 42561 | jjdelcerro | @Override
|
218 | 40435 | jjdelcerro | public DataType getDataType() {
|
219 | 42561 | jjdelcerro | if (featureAttributeGetter != null) { |
220 | return featureAttributeGetter.getDataType();
|
||
221 | } |
||
222 | 40435 | jjdelcerro | return this.dataType; |
223 | } |
||
224 | |||
225 | 43954 | jjdelcerro | public FeatureAttributeDescriptor setDataType(int type) { |
226 | this.dataType = ToolsLocator.getDataTypesManager().get(type);
|
||
227 | return this; |
||
228 | } |
||
229 | |||
230 | 42561 | jjdelcerro | @Override
|
231 | 40435 | jjdelcerro | public DateFormat getDateFormat() { |
232 | return this.dateFormat; |
||
233 | } |
||
234 | |||
235 | 42561 | jjdelcerro | @Override
|
236 | 40435 | jjdelcerro | public Object getDefaultValue() { |
237 | return this.defaultValue; |
||
238 | } |
||
239 | |||
240 | 42561 | jjdelcerro | @Override
|
241 | 40435 | jjdelcerro | public Evaluator getEvaluator() {
|
242 | return this.evaluator; |
||
243 | } |
||
244 | |||
245 | 42561 | jjdelcerro | @Override
|
246 | 40435 | jjdelcerro | public int getGeometryType() { |
247 | 44083 | jjdelcerro | if( this.dataType.getType()!=DataTypes.GEOMETRY ) { |
248 | return Geometry.TYPES.UNKNOWN;
|
||
249 | } |
||
250 | 40435 | jjdelcerro | return this.geometryType; |
251 | } |
||
252 | |||
253 | 42561 | jjdelcerro | @Override
|
254 | 40435 | jjdelcerro | public int getGeometrySubType() { |
255 | 44083 | jjdelcerro | if( this.dataType.getType()!=DataTypes.GEOMETRY ) { |
256 | return Geometry.SUBTYPES.UNKNOWN;
|
||
257 | } |
||
258 | 40435 | jjdelcerro | return this.geometrySubType; |
259 | } |
||
260 | |||
261 | 42561 | jjdelcerro | @Override
|
262 | 40435 | jjdelcerro | public GeometryType getGeomType() {
|
263 | 44083 | jjdelcerro | if( this.dataType.getType()!=DataTypes.GEOMETRY ) { |
264 | return null; |
||
265 | } |
||
266 | 40435 | jjdelcerro | if (this.geomType == null) { |
267 | try {
|
||
268 | 42561 | jjdelcerro | this.geomType
|
269 | = GeometryLocator.getGeometryManager().getGeometryType( |
||
270 | this.geometryType, this.geometrySubType); |
||
271 | 40435 | jjdelcerro | } catch (GeometryException e) {
|
272 | throw new RuntimeException( |
||
273 | 42561 | jjdelcerro | "Error getting geometry type with type = "
|
274 | 40435 | jjdelcerro | + this.geometryType + ", subtype = " |
275 | + this.geometrySubType, e);
|
||
276 | } |
||
277 | } |
||
278 | return this.geomType; |
||
279 | } |
||
280 | |||
281 | 42561 | jjdelcerro | @Override
|
282 | 40435 | jjdelcerro | public int getIndex() { |
283 | return this.index; |
||
284 | } |
||
285 | |||
286 | protected FeatureAttributeDescriptor setIndex(int index) { |
||
287 | this.index = index;
|
||
288 | return this; |
||
289 | } |
||
290 | |||
291 | 42561 | jjdelcerro | @Override
|
292 | 40435 | jjdelcerro | public int getMaximumOccurrences() { |
293 | return this.maximumOccurrences; |
||
294 | } |
||
295 | |||
296 | 42561 | jjdelcerro | @Override
|
297 | 40435 | jjdelcerro | public int getMinimumOccurrences() { |
298 | return this.minimumOccurrences; |
||
299 | } |
||
300 | |||
301 | 42561 | jjdelcerro | @Override
|
302 | 40435 | jjdelcerro | public String getName() { |
303 | return this.name; |
||
304 | } |
||
305 | 43954 | jjdelcerro | |
306 | public FeatureAttributeDescriptor setName(String name) { |
||
307 | this.name = name;
|
||
308 | return this; |
||
309 | } |
||
310 | |||
311 | 42561 | jjdelcerro | @Override
|
312 | 40435 | jjdelcerro | public Class getObjectClass() { |
313 | 42561 | jjdelcerro | if (getDataType().getType() == DataTypes.OBJECT) {
|
314 | 40435 | jjdelcerro | return objectClass;
|
315 | } |
||
316 | 42561 | jjdelcerro | return getDataType().getDefaultClass();
|
317 | 40435 | jjdelcerro | } |
318 | |||
319 | 42561 | jjdelcerro | @Override
|
320 | 40435 | jjdelcerro | public int getPrecision() { |
321 | return this.precision; |
||
322 | } |
||
323 | |||
324 | 42561 | jjdelcerro | @Override
|
325 | 40435 | jjdelcerro | public IProjection getSRS() {
|
326 | return this.SRS; |
||
327 | } |
||
328 | |||
329 | 44077 | jjdelcerro | @Override
|
330 | public Interval getInterval() {
|
||
331 | return this.interval; |
||
332 | } |
||
333 | |||
334 | 44022 | jjdelcerro | public IProjection getSRS(WeakReference storeRef) { |
335 | if( this.SRS==null ) { |
||
336 | FeatureStore store = (FeatureStore) storeRef.get(); |
||
337 | this.SRS = (IProjection) store.getDynValue(DataStore.METADATA_CRS);
|
||
338 | } |
||
339 | return this.SRS; |
||
340 | } |
||
341 | |||
342 | |||
343 | 42561 | jjdelcerro | @Override
|
344 | 40435 | jjdelcerro | public int getSize() { |
345 | return this.size; |
||
346 | } |
||
347 | |||
348 | 42561 | jjdelcerro | @Override
|
349 | 40435 | jjdelcerro | public boolean isPrimaryKey() { |
350 | return this.primaryKey; |
||
351 | } |
||
352 | |||
353 | 42561 | jjdelcerro | @Override
|
354 | 40435 | jjdelcerro | public boolean isReadOnly() { |
355 | 42561 | jjdelcerro | if (this.readOnly) { |
356 | 41335 | jjdelcerro | return true; |
357 | } |
||
358 | 42561 | jjdelcerro | if (this.getEvaluator() != null) { |
359 | 41335 | jjdelcerro | return true; |
360 | } |
||
361 | 42561 | jjdelcerro | if (this.featureAttributeEmulator != null) { |
362 | 41335 | jjdelcerro | return !this.featureAttributeEmulator.allowSetting(); |
363 | } |
||
364 | return false; |
||
365 | 40435 | jjdelcerro | } |
366 | |||
367 | 42561 | jjdelcerro | @Override
|
368 | 40435 | jjdelcerro | public Object getAdditionalInfo(String infoName) { |
369 | if (this.additionalInfo == null) { |
||
370 | return null; |
||
371 | } |
||
372 | return this.additionalInfo.get(infoName); |
||
373 | } |
||
374 | |||
375 | 42561 | jjdelcerro | @Override
|
376 | 40435 | jjdelcerro | public boolean isAutomatic() { |
377 | return this.isAutomatic; |
||
378 | } |
||
379 | |||
380 | private boolean compareObject(Object a, Object b) { |
||
381 | if (a != b) {
|
||
382 | if (a == null) { |
||
383 | return false; |
||
384 | } |
||
385 | return a.equals(b);
|
||
386 | } |
||
387 | return true; |
||
388 | |||
389 | } |
||
390 | |||
391 | 42561 | jjdelcerro | @Override
|
392 | 40435 | jjdelcerro | public boolean equals(Object obj) { |
393 | if (this == obj) { |
||
394 | return true; |
||
395 | } |
||
396 | if (!(obj instanceof DefaultFeatureAttributeDescriptor)) { |
||
397 | return false; |
||
398 | } |
||
399 | 42561 | jjdelcerro | DefaultFeatureAttributeDescriptor other |
400 | = (DefaultFeatureAttributeDescriptor) obj; |
||
401 | 40435 | jjdelcerro | |
402 | if (this.allowNull != other.allowNull) { |
||
403 | return false; |
||
404 | } |
||
405 | |||
406 | if (this.index != other.index) { |
||
407 | return false; |
||
408 | } |
||
409 | |||
410 | if (!compareObject(this.name, other.name)) { |
||
411 | return false; |
||
412 | } |
||
413 | |||
414 | 42561 | jjdelcerro | if (this.getDataType() != other.getDataType()) { |
415 | 40435 | jjdelcerro | return false; |
416 | } |
||
417 | |||
418 | if (this.size != other.size) { |
||
419 | return false; |
||
420 | } |
||
421 | |||
422 | if (!compareObject(this.defaultValue, other.defaultValue)) { |
||
423 | return false; |
||
424 | } |
||
425 | |||
426 | if (!compareObject(this.defaultValue, other.defaultValue)) { |
||
427 | return false; |
||
428 | } |
||
429 | |||
430 | if (this.primaryKey != other.primaryKey) { |
||
431 | return false; |
||
432 | } |
||
433 | |||
434 | if (this.isAutomatic != other.isAutomatic) { |
||
435 | return false; |
||
436 | } |
||
437 | |||
438 | if (this.readOnly != other.readOnly) { |
||
439 | return false; |
||
440 | } |
||
441 | |||
442 | if (this.precision != other.precision) { |
||
443 | return false; |
||
444 | } |
||
445 | |||
446 | if (this.maximumOccurrences != other.maximumOccurrences) { |
||
447 | return false; |
||
448 | } |
||
449 | |||
450 | if (this.minimumOccurrences != other.minimumOccurrences) { |
||
451 | return false; |
||
452 | } |
||
453 | |||
454 | if (this.geometryType != other.geometryType) { |
||
455 | return false; |
||
456 | } |
||
457 | |||
458 | if (this.geometrySubType != other.geometrySubType) { |
||
459 | return false; |
||
460 | } |
||
461 | |||
462 | if (!compareObject(this.evaluator, other.evaluator)) { |
||
463 | return false; |
||
464 | } |
||
465 | |||
466 | if (!compareObject(this.SRS, other.SRS)) { |
||
467 | return false; |
||
468 | } |
||
469 | |||
470 | if (!compareObject(this.dateFormat, other.dateFormat)) { |
||
471 | return false; |
||
472 | } |
||
473 | |||
474 | if (!compareObject(this.objectClass, other.objectClass)) { |
||
475 | return false; |
||
476 | } |
||
477 | |||
478 | return true; |
||
479 | } |
||
480 | |||
481 | 42561 | jjdelcerro | @Override
|
482 | 40435 | jjdelcerro | public void loadFromState(PersistentState state) |
483 | 42561 | jjdelcerro | throws PersistenceException {
|
484 | 40435 | jjdelcerro | allowNull = state.getBoolean("allowNull");
|
485 | 44077 | jjdelcerro | dataType = ToolsLocator.getDataTypesManager().get(state.getInt("dataType"));
|
486 | 40435 | jjdelcerro | // FIXME how persist dateFormat ???
|
487 | // dateFormat;
|
||
488 | defaultValue = state.get("defaultValue");
|
||
489 | |||
490 | index = state.getInt("index");
|
||
491 | maximumOccurrences = state.getInt("maximumOccurrences");
|
||
492 | minimumOccurrences = state.getInt("minimumOccurrences");
|
||
493 | size = state.getInt("size");
|
||
494 | name = state.getString("name");
|
||
495 | try {
|
||
496 | objectClass = Class.forName(state.getString("objectClass")); |
||
497 | } catch (ClassNotFoundException e) { |
||
498 | throw new PersistenceException(e); |
||
499 | } |
||
500 | precision = state.getInt("precision");
|
||
501 | evaluator = (Evaluator) state.get("evaluator");
|
||
502 | primaryKey = state.getBoolean("primaryKey");
|
||
503 | readOnly = state.getBoolean("readOnly");
|
||
504 | String srsId = state.getString("srsId"); |
||
505 | if (srsId != null) { |
||
506 | SRS = CRSFactory.getCRS(srsId); |
||
507 | } |
||
508 | geometryType = state.getInt("geometryType");
|
||
509 | geometrySubType = state.getInt("geometrySubType");
|
||
510 | additionalInfo = (Map) state.get("aditionalInfo"); |
||
511 | isAutomatic = state.getBoolean("isAutomatic");
|
||
512 | 44077 | jjdelcerro | isTime = state.getBoolean("isTime");
|
513 | if( state.hasValue("intervalStart") ) { |
||
514 | long intervalStart = state.getLong("intervalStart"); |
||
515 | long intervalEnd = state.getLong("intervalEnd"); |
||
516 | interval = TimeSupportLocator.getManager().createRelativeInterval(intervalStart, intervalEnd); |
||
517 | } else {
|
||
518 | interval = null;
|
||
519 | } |
||
520 | 40435 | jjdelcerro | } |
521 | |||
522 | 42561 | jjdelcerro | @Override
|
523 | 40435 | jjdelcerro | public void saveToState(PersistentState state) throws PersistenceException { |
524 | state.set("allowNull", allowNull);
|
||
525 | state.set("dataType", dataType);
|
||
526 | // FIXME how persist dateFormat ???
|
||
527 | // dateFormat;
|
||
528 | |||
529 | defaultValue = state.get("defaultValue");
|
||
530 | |||
531 | index = state.getInt("index");
|
||
532 | maximumOccurrences = state.getInt("maximumOccurrences");
|
||
533 | minimumOccurrences = state.getInt("minimumOccurrences");
|
||
534 | size = state.getInt("size");
|
||
535 | name = state.getString("name");
|
||
536 | try {
|
||
537 | objectClass = Class.forName(state.getString("objectClass")); |
||
538 | } catch (ClassNotFoundException e) { |
||
539 | throw new PersistenceException(e); |
||
540 | } |
||
541 | precision = state.getInt("precision");
|
||
542 | evaluator = (Evaluator) state.get("evaluator");
|
||
543 | primaryKey = state.getBoolean("primaryKey");
|
||
544 | readOnly = state.getBoolean("readOnly");
|
||
545 | String srsId = state.getString("srsId"); |
||
546 | if (srsId != null) { |
||
547 | SRS = CRSFactory.getCRS(srsId); |
||
548 | } |
||
549 | geometryType = state.getInt("geometryType");
|
||
550 | geometrySubType = state.getInt("geometrySubType");
|
||
551 | additionalInfo = (Map) state.get("aditionalInfo"); |
||
552 | isAutomatic = state.getBoolean("isAutomatic");
|
||
553 | } |
||
554 | |||
555 | 42563 | jjdelcerro | /*
|
556 | 40435 | jjdelcerro | * Start of DynField interface Implementation
|
557 | 42561 | jjdelcerro | *
|
558 | 40435 | jjdelcerro | */
|
559 | 42634 | fdiaz | |
560 | 43739 | jjdelcerro | @Override
|
561 | 42563 | jjdelcerro | public Tags getTags() {
|
562 | return tags;
|
||
563 | } |
||
564 | 42634 | fdiaz | |
565 | 42561 | jjdelcerro | @Override
|
566 | 40435 | jjdelcerro | public DynObjectValueItem[] getAvailableValues() { |
567 | 42563 | jjdelcerro | return this.availableValues; |
568 | 40435 | jjdelcerro | } |
569 | |||
570 | 42561 | jjdelcerro | @Override
|
571 | 40435 | jjdelcerro | public String getDescription() { |
572 | 42563 | jjdelcerro | if( this.description == null ) { |
573 | return getName();
|
||
574 | } |
||
575 | return this.description; |
||
576 | 40435 | jjdelcerro | } |
577 | |||
578 | 42561 | jjdelcerro | @Override
|
579 | 40435 | jjdelcerro | public Object getMaxValue() { |
580 | 42563 | jjdelcerro | return this.maxValue; |
581 | 40435 | jjdelcerro | } |
582 | |||
583 | 42561 | jjdelcerro | @Override
|
584 | 40435 | jjdelcerro | public Object getMinValue() { |
585 | 42563 | jjdelcerro | return this.minValue; |
586 | 40435 | jjdelcerro | } |
587 | |||
588 | 42561 | jjdelcerro | @Override
|
589 | 40435 | jjdelcerro | public int getTheTypeOfAvailableValues() { |
590 | 42563 | jjdelcerro | return 1; |
591 | 40435 | jjdelcerro | } |
592 | |||
593 | 42561 | jjdelcerro | @Override
|
594 | 40435 | jjdelcerro | public int getType() { |
595 | 42561 | jjdelcerro | if (featureAttributeGetter != null) { |
596 | 40435 | jjdelcerro | return featureAttributeGetter.getDataType().getType();
|
597 | } |
||
598 | return getDataType().getType();
|
||
599 | } |
||
600 | |||
601 | 42561 | jjdelcerro | @Override
|
602 | 40435 | jjdelcerro | public boolean isMandatory() { |
603 | return !allowNull() || isPrimaryKey();
|
||
604 | } |
||
605 | |||
606 | 42561 | jjdelcerro | @Override
|
607 | 40435 | jjdelcerro | public boolean isPersistent() { |
608 | return false; |
||
609 | } |
||
610 | |||
611 | 42561 | jjdelcerro | @Override
|
612 | 40435 | jjdelcerro | public DynField setAvailableValues(DynObjectValueItem[] values) { |
613 | 42563 | jjdelcerro | if ( ArrayUtils.isEmpty(values) ) {
|
614 | this.availableValues = null; |
||
615 | } else {
|
||
616 | this.availableValues = values;
|
||
617 | } |
||
618 | return this; |
||
619 | 40435 | jjdelcerro | } |
620 | |||
621 | 42561 | jjdelcerro | @Override
|
622 | 40435 | jjdelcerro | public DynField setDescription(String description) { |
623 | 42563 | jjdelcerro | this.description = description;
|
624 | return this; |
||
625 | 40435 | jjdelcerro | } |
626 | |||
627 | 42561 | jjdelcerro | @Override
|
628 | 40435 | jjdelcerro | public DynField setMandatory(boolean mandatory) { |
629 | throw new UnsupportedOperationException(); |
||
630 | } |
||
631 | |||
632 | 42561 | jjdelcerro | @Override
|
633 | 40435 | jjdelcerro | public DynField setMaxValue(Object maxValue) { |
634 | 42563 | jjdelcerro | try {
|
635 | this.maxValue = this.coerce(maxValue); |
||
636 | } catch (CoercionException e) {
|
||
637 | throw new IllegalArgumentException(e); |
||
638 | } |
||
639 | return this; |
||
640 | 40435 | jjdelcerro | } |
641 | |||
642 | 42561 | jjdelcerro | @Override
|
643 | 40435 | jjdelcerro | public DynField setMinValue(Object minValue) { |
644 | 42563 | jjdelcerro | try {
|
645 | this.maxValue = this.coerce(minValue); |
||
646 | } catch (CoercionException e) {
|
||
647 | throw new IllegalArgumentException(e); |
||
648 | } |
||
649 | return this; |
||
650 | 40435 | jjdelcerro | } |
651 | |||
652 | 42561 | jjdelcerro | @Override
|
653 | 40435 | jjdelcerro | public DynField setPersistent(boolean persistent) { |
654 | throw new UnsupportedOperationException(); |
||
655 | } |
||
656 | |||
657 | 42561 | jjdelcerro | @Override
|
658 | 40435 | jjdelcerro | public DynField setTheTypeOfAvailableValues(int type) { |
659 | throw new UnsupportedOperationException(); |
||
660 | } |
||
661 | |||
662 | 42561 | jjdelcerro | @Override
|
663 | 40435 | jjdelcerro | public DynField setType(int type) { |
664 | throw new UnsupportedOperationException(); |
||
665 | } |
||
666 | |||
667 | 42561 | jjdelcerro | @Override
|
668 | 40435 | jjdelcerro | public DynField setDefaultDynValue(Object defaultValue) { |
669 | throw new UnsupportedOperationException(); |
||
670 | } |
||
671 | |||
672 | 42561 | jjdelcerro | @Override
|
673 | 40435 | jjdelcerro | public Class getClassOfValue() { |
674 | return null; |
||
675 | } |
||
676 | |||
677 | 42561 | jjdelcerro | @Override
|
678 | 40435 | jjdelcerro | public DynField getElementsType() {
|
679 | return null; |
||
680 | } |
||
681 | |||
682 | 42561 | jjdelcerro | @Override
|
683 | 40435 | jjdelcerro | public DynField setClassOfValue(Class theClass) |
684 | 42561 | jjdelcerro | throws DynFieldIsNotAContainerException {
|
685 | 40435 | jjdelcerro | throw new UnsupportedOperationException(); |
686 | } |
||
687 | |||
688 | 42561 | jjdelcerro | @Override
|
689 | 40435 | jjdelcerro | public DynField setElementsType(DynStruct type)
|
690 | 42561 | jjdelcerro | throws DynFieldIsNotAContainerException {
|
691 | 40435 | jjdelcerro | throw new UnsupportedOperationException(); |
692 | } |
||
693 | |||
694 | 42561 | jjdelcerro | @Override
|
695 | 40435 | jjdelcerro | public DynField setElementsType(int type) |
696 | 42561 | jjdelcerro | throws DynFieldIsNotAContainerException {
|
697 | 40435 | jjdelcerro | throw new UnsupportedOperationException(); |
698 | } |
||
699 | |||
700 | 42561 | jjdelcerro | @Override
|
701 | 40435 | jjdelcerro | public DynField setSubtype(String subtype) { |
702 | throw new UnsupportedOperationException(); |
||
703 | } |
||
704 | |||
705 | 42561 | jjdelcerro | @Override
|
706 | 40435 | jjdelcerro | public void validate(Object value) throws DynFieldValidateException { |
707 | 42561 | jjdelcerro | |
708 | 40435 | jjdelcerro | if (value == null && !this.allowNull()) { |
709 | throw new DynFieldValidateException(value, this, null); |
||
710 | } |
||
711 | 42561 | jjdelcerro | |
712 | 40435 | jjdelcerro | try {
|
713 | this.dataType.coerce(value);
|
||
714 | } catch (CoercionException e) {
|
||
715 | throw new DynFieldValidateException(value, this, e); |
||
716 | } |
||
717 | 42561 | jjdelcerro | |
718 | 40435 | jjdelcerro | /*
|
719 | * Other checks will be needed
|
||
720 | */
|
||
721 | } |
||
722 | |||
723 | 42561 | jjdelcerro | @Override
|
724 | 40435 | jjdelcerro | public String getSubtype() { |
725 | 42561 | jjdelcerro | if (featureAttributeGetter != null) { |
726 | 40435 | jjdelcerro | return featureAttributeGetter.getDataType().getSubtype();
|
727 | 42561 | jjdelcerro | } |
728 | 40435 | jjdelcerro | return this.dataType.getSubtype(); |
729 | } |
||
730 | |||
731 | 42561 | jjdelcerro | @Override
|
732 | 42563 | jjdelcerro | public Object coerce(Object value) throws CoercionException { |
733 | if ( value == null ) { |
||
734 | return value; // O debe devolver this.defaultValue |
||
735 | } |
||
736 | try {
|
||
737 | return this.getDataType().coerce(value); |
||
738 | } catch(Exception ex){ |
||
739 | throw new RuntimeException(ex); |
||
740 | } |
||
741 | 40435 | jjdelcerro | } |
742 | |||
743 | 42561 | jjdelcerro | @Override
|
744 | 40435 | jjdelcerro | public DynField setAvailableValues(List values) { |
745 | 42563 | jjdelcerro | if ( values == null || values.isEmpty() ) { |
746 | this.availableValues = null; |
||
747 | } else {
|
||
748 | this.availableValues = (DynObjectValueItem[]) values.toArray( |
||
749 | new DynObjectValueItem[values.size()]
|
||
750 | ); |
||
751 | } |
||
752 | return this; |
||
753 | 40435 | jjdelcerro | } |
754 | |||
755 | 42561 | jjdelcerro | @Override
|
756 | 40435 | jjdelcerro | public String getGroup() { |
757 | 42563 | jjdelcerro | return this.groupName; |
758 | 40435 | jjdelcerro | } |
759 | |||
760 | 42561 | jjdelcerro | @Override
|
761 | 40435 | jjdelcerro | public int getOder() { |
762 | 42563 | jjdelcerro | return this.order; |
763 | 40435 | jjdelcerro | } |
764 | |||
765 | 42561 | jjdelcerro | @Override
|
766 | 41323 | jjdelcerro | public String getLabel() { |
767 | 42563 | jjdelcerro | if( this.label == null ) { |
768 | return this.getName(); |
||
769 | } |
||
770 | return this.label; |
||
771 | 41323 | jjdelcerro | } |
772 | |||
773 | 42561 | jjdelcerro | @Override
|
774 | 41323 | jjdelcerro | public DynField setLabel(String label) { |
775 | 42563 | jjdelcerro | this.label = label;
|
776 | return this; |
||
777 | 41323 | jjdelcerro | } |
778 | |||
779 | 42561 | jjdelcerro | @Override
|
780 | 40435 | jjdelcerro | public DynField setGroup(String groupName) { |
781 | 42563 | jjdelcerro | this.groupName = groupName;
|
782 | return this; |
||
783 | 40435 | jjdelcerro | } |
784 | |||
785 | 42561 | jjdelcerro | @Override
|
786 | 40435 | jjdelcerro | public DynField setOrder(int order) { |
787 | 42563 | jjdelcerro | this.order = order;
|
788 | return this; |
||
789 | 40435 | jjdelcerro | } |
790 | |||
791 | 42561 | jjdelcerro | @Override
|
792 | 40435 | jjdelcerro | public DynField setHidden(boolean hidden) { |
793 | 42563 | jjdelcerro | this.hidden = hidden;
|
794 | return this; |
||
795 | 40435 | jjdelcerro | } |
796 | |||
797 | 42561 | jjdelcerro | @Override
|
798 | 40435 | jjdelcerro | public boolean isHidden() { |
799 | 42563 | jjdelcerro | return this.hidden; |
800 | 40435 | jjdelcerro | } |
801 | |||
802 | 42561 | jjdelcerro | @Override
|
803 | 40435 | jjdelcerro | public DynField setReadOnly(boolean arg0) { |
804 | throw new UnsupportedOperationException(); |
||
805 | } |
||
806 | |||
807 | 42561 | jjdelcerro | @Override
|
808 | 40435 | jjdelcerro | public boolean isContainer() { |
809 | return false; |
||
810 | } |
||
811 | |||
812 | 42561 | jjdelcerro | @Override
|
813 | 40435 | jjdelcerro | public Class getClassOfItems() { |
814 | return null; |
||
815 | } |
||
816 | |||
817 | 42561 | jjdelcerro | @Override
|
818 | 40435 | jjdelcerro | public DynField setDefaultFieldValue(Object defaultValue) { |
819 | throw new UnsupportedOperationException(); |
||
820 | } |
||
821 | |||
822 | 42561 | jjdelcerro | @Override
|
823 | 40435 | jjdelcerro | public DynField setClassOfItems(Class theClass) { |
824 | throw new UnsupportedOperationException(); |
||
825 | } |
||
826 | |||
827 | 42561 | jjdelcerro | @Override
|
828 | 40435 | jjdelcerro | public DynField setType(DataType type) {
|
829 | throw new UnsupportedOperationException(); |
||
830 | } |
||
831 | |||
832 | 42561 | jjdelcerro | @Override
|
833 | public boolean isTime() { |
||
834 | return isTime;
|
||
835 | } |
||
836 | 40435 | jjdelcerro | |
837 | 42561 | jjdelcerro | @Override
|
838 | 40435 | jjdelcerro | public FeatureAttributeGetter getFeatureAttributeGetter() {
|
839 | 42561 | jjdelcerro | return featureAttributeGetter;
|
840 | 40435 | jjdelcerro | } |
841 | |||
842 | 42561 | jjdelcerro | @Override
|
843 | 40435 | jjdelcerro | public void setFeatureAttributeGetter( |
844 | 42561 | jjdelcerro | FeatureAttributeGetter featureAttributeTransform) { |
845 | this.featureAttributeGetter = featureAttributeTransform;
|
||
846 | } |
||
847 | 41335 | jjdelcerro | |
848 | 42561 | jjdelcerro | @Override
|
849 | 41335 | jjdelcerro | public FeatureAttributeEmulator getFeatureAttributeEmulator() {
|
850 | return this.featureAttributeEmulator; |
||
851 | } |
||
852 | |||
853 | 43954 | jjdelcerro | public FeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator) {
|
854 | this.featureAttributeEmulator = featureAttributeEmulator;
|
||
855 | return this; |
||
856 | } |
||
857 | |||
858 | 42561 | jjdelcerro | @Override
|
859 | 41638 | jjdelcerro | public boolean isIndexed() { |
860 | return this.indexed; |
||
861 | } |
||
862 | |||
863 | 42561 | jjdelcerro | @Override
|
864 | 41638 | jjdelcerro | public boolean allowIndexDuplicateds() { |
865 | return this.allowIndexDuplicateds; |
||
866 | } |
||
867 | |||
868 | 42561 | jjdelcerro | @Override
|
869 | 41638 | jjdelcerro | public boolean isIndexAscending() { |
870 | return this.isIndexAscending; |
||
871 | } |
||
872 | |||
873 | 42563 | jjdelcerro | @Override
|
874 | public DynField setClassOfValue(DynStruct dynStrct) {
|
||
875 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
||
876 | } |
||
877 | |||
878 | @Override
|
||
879 | public DynField setClassOfValue(String theClassNameOfValue) { |
||
880 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
||
881 | } |
||
882 | |||
883 | @Override
|
||
884 | public String getClassNameOfValue() { |
||
885 | 42634 | fdiaz | return null; |
886 | 42563 | jjdelcerro | } |
887 | |||
888 | @Override
|
||
889 | public DynStruct getDynClassOfValue() {
|
||
890 | 42634 | fdiaz | return null; |
891 | 42563 | jjdelcerro | } |
892 | |||
893 | @Override
|
||
894 | public DynField setTypeOfItems(int type) { |
||
895 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
||
896 | } |
||
897 | |||
898 | @Override
|
||
899 | public int getTypeOfItems() { |
||
900 | 42634 | fdiaz | return DataTypes.INVALID;
|
901 | 42563 | jjdelcerro | } |
902 | |||
903 | @Override
|
||
904 | public DynField setClassOfItems(DynStruct dynStrct) {
|
||
905 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
||
906 | } |
||
907 | |||
908 | @Override
|
||
909 | public DynField setClassOfItems(String theClassNameOfValue) { |
||
910 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
||
911 | } |
||
912 | |||
913 | @Override
|
||
914 | public String getClassNameOfItems() { |
||
915 | 42634 | fdiaz | return null; |
916 | 42563 | jjdelcerro | } |
917 | |||
918 | @Override
|
||
919 | public DynStruct getDynClassOfItems() {
|
||
920 | 42634 | fdiaz | return null; |
921 | 42563 | jjdelcerro | } |
922 | |||
923 | @Override
|
||
924 | public DynField setRelationType(int relationType) { |
||
925 | throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
||
926 | } |
||
927 | |||
928 | @Override
|
||
929 | public int getRelationType() { |
||
930 | return RELATION_TYPE_NONE;
|
||
931 | } |
||
932 | |||
933 | 42606 | jjdelcerro | @Override
|
934 | 42775 | jjdelcerro | public DynField setAvailableValues(DynMethod availableValuesMethod) {
|
935 | this.availableValuesMethod = availableValuesMethod;
|
||
936 | return this; |
||
937 | 42606 | jjdelcerro | } |
938 | |||
939 | @Override
|
||
940 | 42775 | jjdelcerro | public DynObjectValueItem[] getAvailableValues(DynObject self) { |
941 | if( this.availableValuesMethod != null ) { |
||
942 | DynObjectValueItem[] values;
|
||
943 | try {
|
||
944 | values = (DynObjectValueItem[]) this.availableValuesMethod.invoke(self,new Object[] {this}); |
||
945 | } catch (DynMethodException ex) {
|
||
946 | return this.availableValues; |
||
947 | } |
||
948 | 42606 | jjdelcerro | if( values != null ) { |
949 | return values;
|
||
950 | } |
||
951 | } |
||
952 | return this.availableValues; |
||
953 | } |
||
954 | |||
955 | 42775 | jjdelcerro | @Override
|
956 | public DynMethod getAvailableValuesMethod() {
|
||
957 | return this.availableValuesMethod; |
||
958 | } |
||
959 | |||
960 | @Override
|
||
961 | public boolean isAvailableValuesCalculated() { |
||
962 | return this.availableValuesMethod!=null; |
||
963 | } |
||
964 | |||
965 | @Override
|
||
966 | public DynMethod getCalculateMethod() {
|
||
967 | return this.calculateMethod; |
||
968 | } |
||
969 | |||
970 | @Override
|
||
971 | public DynField setCalculateMethod(DynMethod method) {
|
||
972 | this.calculateMethod = method;
|
||
973 | return this; |
||
974 | } |
||
975 | |||
976 | @Override
|
||
977 | public boolean isCalculated() { |
||
978 | return this.calculateMethod != null; |
||
979 | } |
||
980 | |||
981 | @Override
|
||
982 | public Object getCalculatedValue(DynObject self) { |
||
983 | try {
|
||
984 | return this.calculateMethod.invoke(self, new Object[] { this }); |
||
985 | } catch (DynMethodException ex) {
|
||
986 | throw new RuntimeException(ex); |
||
987 | } |
||
988 | } |
||
989 | |||
990 | @Override
|
||
991 | public DynField setValidateElements(boolean validate) { |
||
992 | return this; |
||
993 | } |
||
994 | |||
995 | @Override
|
||
996 | public boolean getValidateElements() { |
||
997 | return false; |
||
998 | } |
||
999 | |||
1000 | 41212 | jjdelcerro | private class ConstantValueEvaluator extends AbstractEvaluator { |
1001 | 42561 | jjdelcerro | |
1002 | @Override
|
||
1003 | 41212 | jjdelcerro | public Object evaluate(EvaluatorData data) throws EvaluatorException { |
1004 | return defaultValue;
|
||
1005 | } |
||
1006 | 42561 | jjdelcerro | |
1007 | @Override
|
||
1008 | 41212 | jjdelcerro | public String getName() { |
1009 | 42561 | jjdelcerro | return "Constant attribute " + name; |
1010 | 41212 | jjdelcerro | } |
1011 | } |
||
1012 | 41335 | jjdelcerro | |
1013 | 41212 | jjdelcerro | public void setConstantValue(boolean isConstantValue) { |
1014 | 42561 | jjdelcerro | if (isConstantValue) {
|
1015 | 41212 | jjdelcerro | /* Cuando un attributo tiene asociado un evaluador, este se interpreta
|
1016 | 42634 | fdiaz | * como que no debe cargarse de la fuente de datos subyacente, siendo
|
1017 | 41212 | jjdelcerro | * el evaluador el que se encarga de proporcionar su valor.
|
1018 | * Nos limitamos a asignar un evaluador que retorna simpre el valor
|
||
1019 | * por defecto para ese attributo.
|
||
1020 | */
|
||
1021 | this.evaluator = new ConstantValueEvaluator(); |
||
1022 | } else {
|
||
1023 | this.evaluator = null; |
||
1024 | } |
||
1025 | } |
||
1026 | 42561 | jjdelcerro | |
1027 | 43739 | jjdelcerro | @Override
|
1028 | 43135 | jjdelcerro | public boolean isComputed() { |
1029 | return featureAttributeEmulator!=null || evaluator!=null; |
||
1030 | } |
||
1031 | 43739 | jjdelcerro | |
1032 | @Override
|
||
1033 | public FeatureStore getStore() {
|
||
1034 | FeatureType ftype = this.getFeatureType();
|
||
1035 | if( ftype == null ) { |
||
1036 | return null; |
||
1037 | } |
||
1038 | return ftype.getStore();
|
||
1039 | } |
||
1040 | |||
1041 | @Override
|
||
1042 | public FeatureType getFeatureType() {
|
||
1043 | if( this.typeRef==null ) { |
||
1044 | return null; |
||
1045 | } |
||
1046 | return (FeatureType) this.typeRef.get(); |
||
1047 | } |
||
1048 | 40435 | jjdelcerro | } |