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 / DefaultFeatureType.java @ 42795
History | View | Annotate | Download (22 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.dal.feature.impl; |
25 |
|
26 |
import java.lang.ref.WeakReference; |
27 |
import java.util.ArrayList; |
28 |
import java.util.Arrays; |
29 |
import java.util.Collections; |
30 |
import java.util.HashSet; |
31 |
import java.util.Iterator; |
32 |
import java.util.List; |
33 |
import java.util.Set; |
34 |
|
35 |
import org.cresques.cts.IProjection; |
36 |
|
37 |
import org.gvsig.fmap.dal.DataTypes; |
38 |
import org.gvsig.fmap.dal.exception.DataException; |
39 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
40 |
import org.gvsig.fmap.dal.feature.Feature; |
41 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
42 |
import org.gvsig.fmap.dal.feature.FeatureAttributeEmulator; |
43 |
import org.gvsig.fmap.dal.feature.FeatureRules; |
44 |
import org.gvsig.fmap.dal.feature.FeatureType; |
45 |
import org.gvsig.tools.dynobject.DynClass; |
46 |
import org.gvsig.tools.dynobject.DynField; |
47 |
import org.gvsig.tools.dynobject.DynMethod; |
48 |
import org.gvsig.tools.dynobject.DynObject; |
49 |
import org.gvsig.tools.dynobject.DynObjectValueItem; |
50 |
import org.gvsig.tools.dynobject.DynStruct; |
51 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
52 |
import org.gvsig.tools.dynobject.exception.DynObjectValidateException; |
53 |
|
54 |
public class DefaultFeatureType extends ArrayList<FeatureAttributeDescriptor> implements FeatureType, |
55 |
DynClass, org.gvsig.tools.lang.Cloneable { |
56 |
|
57 |
/**
|
58 |
*
|
59 |
*/
|
60 |
private static final long serialVersionUID = -7988721447349282215L; |
61 |
|
62 |
private DefaultFeatureRules rules;
|
63 |
protected boolean hasEvaluators; |
64 |
protected boolean hasEmulators; |
65 |
protected String defaultGeometryAttributeName; |
66 |
protected int defaultGeometryAttributeIndex; |
67 |
protected int defaultTimeAttributeIndex; |
68 |
private String id; |
69 |
protected boolean hasOID; |
70 |
protected boolean allowAtomaticValues; |
71 |
protected FeatureAttributeDescriptor[] pk = null; |
72 |
protected String internalID = null; |
73 |
|
74 |
private List srsList = null; |
75 |
|
76 |
protected DefaultFeatureType(String id) { |
77 |
this.internalID = Integer.toHexString((int) (Math.random()*100000)).toUpperCase(); |
78 |
this.id = id;
|
79 |
this.rules = new DefaultFeatureRules(); |
80 |
this.hasEvaluators = false; |
81 |
this.hasEmulators = false; |
82 |
this.defaultGeometryAttributeName = null; |
83 |
this.defaultGeometryAttributeIndex = -1; |
84 |
this.defaultTimeAttributeIndex = -1; |
85 |
this.allowAtomaticValues = false; |
86 |
} |
87 |
|
88 |
protected DefaultFeatureType() {
|
89 |
this("default"); |
90 |
} |
91 |
|
92 |
protected DefaultFeatureType(DefaultFeatureType other) {
|
93 |
this("default"); |
94 |
initialize(other, true);
|
95 |
} |
96 |
|
97 |
protected DefaultFeatureType(DefaultFeatureType other,
|
98 |
boolean copyAttributes) {
|
99 |
this("default"); |
100 |
initialize(other, copyAttributes); |
101 |
} |
102 |
|
103 |
protected void initialize(DefaultFeatureType other, boolean copyAttributes) { |
104 |
this.id = other.getId();
|
105 |
if (copyAttributes) {
|
106 |
Iterator iter = other.iterator();
|
107 |
DefaultFeatureAttributeDescriptor attr; |
108 |
while (iter.hasNext()) {
|
109 |
attr = (DefaultFeatureAttributeDescriptor) iter.next(); |
110 |
this.intitalizeAddAttibute(attr);
|
111 |
} |
112 |
if( other.pk!=null ) { |
113 |
this.pk = new FeatureAttributeDescriptor[other.pk.length]; |
114 |
for( int i=0; i<other.pk.length; i++ ) { |
115 |
this.pk[i] = other.pk[i].getCopy();
|
116 |
} |
117 |
} |
118 |
} |
119 |
this.defaultGeometryAttributeName = other.defaultGeometryAttributeName;
|
120 |
this.hasEvaluators = other.hasEvaluators;
|
121 |
this.hasEmulators = other.hasEmulators;
|
122 |
this.rules = (DefaultFeatureRules) other.rules.getCopy();
|
123 |
this.defaultGeometryAttributeIndex = other.defaultGeometryAttributeIndex;
|
124 |
this.defaultTimeAttributeIndex = other.defaultTimeAttributeIndex;
|
125 |
this.hasOID = other.hasOID;
|
126 |
this.id = other.id; // XXX ???? copiar o no esto???? |
127 |
this.internalID = other.internalID;
|
128 |
} |
129 |
|
130 |
protected void intitalizeAddAttibute(DefaultFeatureAttributeDescriptor attr) { |
131 |
super.add(attr.getCopy());
|
132 |
} |
133 |
|
134 |
public String getId() { |
135 |
return this.id; |
136 |
} |
137 |
|
138 |
public Object get(String name) { |
139 |
FeatureAttributeDescriptor attr; |
140 |
Iterator iter = this.iterator(); |
141 |
while (iter.hasNext()) {
|
142 |
attr = (FeatureAttributeDescriptor) iter.next(); |
143 |
if (attr.getName().equalsIgnoreCase(name)) {
|
144 |
return attr;
|
145 |
} |
146 |
} |
147 |
return null; |
148 |
} |
149 |
|
150 |
public FeatureAttributeDescriptor getAttributeDescriptor(String name) { |
151 |
FeatureAttributeDescriptor attr; |
152 |
Iterator iter = this.iterator(); |
153 |
while (iter.hasNext()) {
|
154 |
attr = (FeatureAttributeDescriptor) iter.next(); |
155 |
if (attr.getName().equalsIgnoreCase(name)) {
|
156 |
return attr;
|
157 |
} |
158 |
} |
159 |
return null; |
160 |
} |
161 |
|
162 |
public FeatureAttributeDescriptor getAttributeDescriptor(int index) { |
163 |
return (FeatureAttributeDescriptor) super.get(index); |
164 |
} |
165 |
|
166 |
public FeatureType getCopy() {
|
167 |
return new DefaultFeatureType(this); |
168 |
} |
169 |
|
170 |
public Object clone() { |
171 |
return this.getCopy(); |
172 |
} |
173 |
|
174 |
public int getDefaultGeometryAttributeIndex() { |
175 |
return this.defaultGeometryAttributeIndex; |
176 |
} |
177 |
|
178 |
public String getDefaultGeometryAttributeName() { |
179 |
return this.defaultGeometryAttributeName; |
180 |
} |
181 |
|
182 |
public EditableFeatureType getEditable() {
|
183 |
return new DefaultEditableFeatureType(this); |
184 |
} |
185 |
|
186 |
public int getIndex(String name) { |
187 |
FeatureAttributeDescriptor attr; |
188 |
Iterator iter = this.iterator(); |
189 |
while (iter.hasNext()) {
|
190 |
attr = (FeatureAttributeDescriptor) iter.next(); |
191 |
if (attr.getName().equalsIgnoreCase(name)) {
|
192 |
return attr.getIndex();
|
193 |
} |
194 |
} |
195 |
return -1; |
196 |
} |
197 |
|
198 |
public FeatureRules getRules() {
|
199 |
return this.rules; |
200 |
} |
201 |
|
202 |
public boolean hasEvaluators() { |
203 |
return this.hasEvaluators; |
204 |
} |
205 |
|
206 |
public boolean hasEmulators() { |
207 |
return this.hasEmulators; |
208 |
} |
209 |
|
210 |
public List getSRSs() { |
211 |
if (this.srsList == null) { |
212 |
ArrayList tmp = new ArrayList(); |
213 |
Iterator iter = iterator();
|
214 |
Iterator tmpIter;
|
215 |
boolean allreadyHave;
|
216 |
IProjection tmpSRS; |
217 |
FeatureAttributeDescriptor attr; |
218 |
while (iter.hasNext()){
|
219 |
attr = (FeatureAttributeDescriptor) iter.next(); |
220 |
if (attr.getDataType().getType() == DataTypes.GEOMETRY
|
221 |
&& attr.getSRS() != null) {
|
222 |
allreadyHave = false;
|
223 |
tmpIter = tmp.iterator(); |
224 |
while (tmpIter.hasNext()) {
|
225 |
tmpSRS = (IProjection) tmpIter.next(); |
226 |
if (tmpSRS.getAbrev().equals(attr.getSRS().getAbrev())) {
|
227 |
allreadyHave = true;
|
228 |
break;
|
229 |
} |
230 |
} |
231 |
if (!allreadyHave) {
|
232 |
tmp.add(attr.getSRS()); |
233 |
} |
234 |
} |
235 |
} |
236 |
this.srsList = Collections.unmodifiableList(tmp); |
237 |
} |
238 |
return this.srsList; |
239 |
} |
240 |
|
241 |
public IProjection getDefaultSRS() {
|
242 |
if (this.getDefaultGeometryAttributeIndex() < 0) { |
243 |
return null; |
244 |
} |
245 |
return this.getAttributeDescriptor( |
246 |
this.getDefaultGeometryAttributeIndex()).getSRS();
|
247 |
} |
248 |
|
249 |
public void validateFeature(Feature feature, int mode) throws DataException { |
250 |
DefaultFeatureRules rules = (DefaultFeatureRules) this.getRules();
|
251 |
rules.validate(feature,mode); |
252 |
} |
253 |
|
254 |
public FeatureType getSubtype(String[] names) throws DataException { |
255 |
if( names==null || names.length <1) { |
256 |
return (FeatureType) this.clone(); |
257 |
} |
258 |
return new SubtypeFeatureType(this, names, null); |
259 |
} |
260 |
|
261 |
public FeatureType getSubtype(String[] names, String[] constantsNames) throws DataException { |
262 |
if( (names==null || names.length <1) && (constantsNames==null || constantsNames.length <1) ) { |
263 |
return (FeatureType) this.clone(); |
264 |
} |
265 |
return new SubtypeFeatureType(this, names,constantsNames); |
266 |
} |
267 |
|
268 |
public boolean isSubtypeOf(FeatureType featureType) { |
269 |
return false; |
270 |
} |
271 |
|
272 |
|
273 |
|
274 |
class SubtypeFeatureType extends DefaultFeatureType { |
275 |
/**
|
276 |
*
|
277 |
*/
|
278 |
private static final long serialVersionUID = 6913732960073922540L; |
279 |
WeakReference parent;
|
280 |
|
281 |
SubtypeFeatureType(DefaultFeatureType parent, String[] names, String[] constantsNames) |
282 |
throws DataException {
|
283 |
super(parent, false); |
284 |
DefaultFeatureAttributeDescriptor attrcopy; |
285 |
DefaultFeatureAttributeDescriptor attr; |
286 |
Set attrnames = null; |
287 |
|
288 |
// Copy attributes
|
289 |
if ( names != null && names.length > 0 ) { |
290 |
attrnames = new HashSet(); |
291 |
attrnames.addAll(Arrays.asList(names));
|
292 |
if ( parent.hasEmulators ) {
|
293 |
for ( int i = 0; i < parent.size(); i++ ) { |
294 |
attr = (DefaultFeatureAttributeDescriptor) parent.getAttributeDescriptor(i); |
295 |
FeatureAttributeEmulator emulator = attr.getFeatureAttributeEmulator(); |
296 |
if ( emulator != null ) { |
297 |
String ss[] = emulator.getRequiredFieldNames(); |
298 |
if ( ss != null ) { |
299 |
attrnames.addAll(Arrays.asList(ss));
|
300 |
} |
301 |
} |
302 |
} |
303 |
} |
304 |
Iterator it = attrnames.iterator();
|
305 |
int i = 0; |
306 |
while ( it.hasNext() ) {
|
307 |
String name = (String) it.next(); |
308 |
attr = (DefaultFeatureAttributeDescriptor) parent |
309 |
.getAttributeDescriptor(name); |
310 |
if ( attr == null ) { |
311 |
throw new SubtypeFeatureTypeNameException(name, parent |
312 |
.getId()); |
313 |
} |
314 |
attrcopy = new DefaultFeatureAttributeDescriptor(attr);
|
315 |
this.add(attrcopy);
|
316 |
attrcopy.index = i++; |
317 |
} |
318 |
|
319 |
} else {
|
320 |
for ( int i = 0; i < parent.size(); i++ ) { |
321 |
attr = (DefaultFeatureAttributeDescriptor) parent.getAttributeDescriptor(i); |
322 |
attrcopy = new DefaultFeatureAttributeDescriptor(attr);
|
323 |
this.add(attrcopy);
|
324 |
attrcopy.index = i; |
325 |
} |
326 |
} |
327 |
|
328 |
// Set the consttants attributes.
|
329 |
if ( constantsNames != null && constantsNames.length > 0 ) { |
330 |
for ( int i = 0; i < constantsNames.length; i++ ) { |
331 |
if ( attrnames != null && attrnames.contains(constantsNames[i]) ) { |
332 |
continue;
|
333 |
} |
334 |
attr = (DefaultFeatureAttributeDescriptor) this.getAttributeDescriptor(constantsNames[i]);
|
335 |
attr.setConstantValue(true);
|
336 |
} |
337 |
} |
338 |
|
339 |
// Add missing pk fiels if any
|
340 |
if ( !parent.hasOID() ) {
|
341 |
Iterator iter = parent.iterator();
|
342 |
while ( iter.hasNext() ) {
|
343 |
attr = (DefaultFeatureAttributeDescriptor) iter.next(); |
344 |
if ( attr.isPrimaryKey() && this.getIndex(attr.getName()) < 0 ) { |
345 |
attrcopy = new DefaultFeatureAttributeDescriptor(attr);
|
346 |
this.add(attrcopy);
|
347 |
attrcopy.index = this.size() - 1; |
348 |
} |
349 |
} |
350 |
} |
351 |
|
352 |
this.defaultGeometryAttributeIndex = this |
353 |
.getIndex(this.defaultGeometryAttributeName);
|
354 |
if ( this.defaultGeometryAttributeIndex < 0 ) { |
355 |
this.defaultGeometryAttributeName = null; |
356 |
} |
357 |
this.parent = new WeakReference(parent); |
358 |
} |
359 |
|
360 |
public FeatureType getSubtype(String[] names) throws DataException { |
361 |
return new SubtypeFeatureType((DefaultFeatureType) this.parent |
362 |
.get(), names, null);
|
363 |
} |
364 |
|
365 |
public boolean isSubtypeOf(FeatureType featureType) { |
366 |
if (featureType == null) { |
367 |
return false; |
368 |
} |
369 |
FeatureType parent = (FeatureType) this.parent.get();
|
370 |
return featureType.equals(parent);
|
371 |
} |
372 |
|
373 |
public EditableFeatureType getEditable() {
|
374 |
throw new UnsupportedOperationException(); |
375 |
} |
376 |
} |
377 |
|
378 |
public class SubtypeFeatureTypeNameException extends DataException { |
379 |
|
380 |
/**
|
381 |
*
|
382 |
*/
|
383 |
private static final long serialVersionUID = -4414242486723260101L; |
384 |
private final static String MESSAGE_FORMAT = "Attribute name '%(name)s' not found in type (%(type)s)."; |
385 |
private final static String MESSAGE_KEY = "_SubtypeFeatureTypeNameException"; |
386 |
|
387 |
public SubtypeFeatureTypeNameException(String name, String type) { |
388 |
super(MESSAGE_FORMAT, MESSAGE_KEY, serialVersionUID);
|
389 |
setValue("name", name);
|
390 |
setValue("type", type);
|
391 |
} |
392 |
} |
393 |
|
394 |
public boolean hasOID() { |
395 |
return hasOID;
|
396 |
} |
397 |
public String toString(){ |
398 |
StringBuffer s = new StringBuffer(); |
399 |
s.append(this.getId());
|
400 |
s.append(":[");
|
401 |
String attName;
|
402 |
for (int i = 0; i < size(); i++) { |
403 |
attName =((FeatureAttributeDescriptor)get(i)).getName().toString(); |
404 |
s.append(attName); |
405 |
if (i < size() - 1) { |
406 |
s.append(',');
|
407 |
} |
408 |
} |
409 |
s.append(']');
|
410 |
return s.toString();
|
411 |
} |
412 |
|
413 |
public Iterator iterator() { |
414 |
return getIterator(super.iterator()); |
415 |
} |
416 |
|
417 |
protected Iterator getIterator(Iterator iter) { |
418 |
return new DelegatedIterator(iter); |
419 |
} |
420 |
|
421 |
protected class DelegatedIterator implements Iterator { |
422 |
|
423 |
protected Iterator iterator; |
424 |
|
425 |
public DelegatedIterator(Iterator iter) { |
426 |
this.iterator = iter;
|
427 |
} |
428 |
|
429 |
public boolean hasNext() { |
430 |
return iterator.hasNext();
|
431 |
} |
432 |
|
433 |
public Object next() { |
434 |
return iterator.next();
|
435 |
} |
436 |
|
437 |
public void remove() { |
438 |
throw new UnsupportedOperationException(); |
439 |
} |
440 |
|
441 |
} |
442 |
|
443 |
public boolean allowAutomaticValues() { |
444 |
return this.allowAtomaticValues; |
445 |
} |
446 |
|
447 |
public FeatureAttributeDescriptor[] getAttributeDescriptors() { |
448 |
return (FeatureAttributeDescriptor[]) super |
449 |
.toArray(new FeatureAttributeDescriptor[super.size()]); |
450 |
} |
451 |
|
452 |
public FeatureAttributeDescriptor[] getPrimaryKey() { |
453 |
if (pk == null) { |
454 |
List pkList = new ArrayList(); |
455 |
Iterator iter = super.iterator(); |
456 |
FeatureAttributeDescriptor attr; |
457 |
while (iter.hasNext()){
|
458 |
attr = (FeatureAttributeDescriptor) iter.next(); |
459 |
if (attr.isPrimaryKey()){
|
460 |
pkList.add(attr); |
461 |
} |
462 |
} |
463 |
pk = (FeatureAttributeDescriptor[]) pkList
|
464 |
.toArray(new FeatureAttributeDescriptor[pkList.size()]);
|
465 |
} |
466 |
return pk;
|
467 |
} |
468 |
|
469 |
public FeatureAttributeDescriptor getDefaultGeometryAttribute() {
|
470 |
if (this.defaultGeometryAttributeIndex < 0) { |
471 |
return null; |
472 |
} |
473 |
return (FeatureAttributeDescriptor) super |
474 |
.get(this.defaultGeometryAttributeIndex);
|
475 |
} |
476 |
|
477 |
|
478 |
|
479 |
public boolean equals(Object other) { |
480 |
if (this == other) { |
481 |
return true; |
482 |
} |
483 |
if (!(other instanceof DefaultFeatureType)) { |
484 |
return false; |
485 |
} |
486 |
DefaultFeatureType otherType = (DefaultFeatureType) other; |
487 |
if (!this.id.equals(otherType.id)) { |
488 |
return false; |
489 |
} |
490 |
if (this.size() != otherType.size()) { |
491 |
return false; |
492 |
} |
493 |
FeatureAttributeDescriptor attr,attrOther; |
494 |
Iterator iter,iterOther;
|
495 |
iter = this.iterator();
|
496 |
iterOther = otherType.iterator(); |
497 |
while (iter.hasNext()) {
|
498 |
attr = (FeatureAttributeDescriptor) iter.next(); |
499 |
attrOther = (FeatureAttributeDescriptor) iterOther.next(); |
500 |
if (!attr.equals(attrOther)) {
|
501 |
return false; |
502 |
} |
503 |
} |
504 |
|
505 |
if (defaultGeometryAttributeName != otherType.defaultGeometryAttributeName) {
|
506 |
if (defaultGeometryAttributeName == null) { |
507 |
return false; |
508 |
} |
509 |
return defaultGeometryAttributeName
|
510 |
.equals(otherType.defaultGeometryAttributeName); |
511 |
|
512 |
} |
513 |
return true; |
514 |
|
515 |
} |
516 |
|
517 |
/**
|
518 |
* Start of DynClass interface implementation
|
519 |
* READONLY
|
520 |
*/
|
521 |
|
522 |
public DynField addDynField(String name) { |
523 |
throw new UnsupportedOperationException(); |
524 |
} |
525 |
|
526 |
public DynField getDeclaredDynField(String name) { |
527 |
return (DynField) getAttributeDescriptor(name);
|
528 |
} |
529 |
|
530 |
public DynField[] getDeclaredDynFields() { |
531 |
return (DynField[]) getAttributeDescriptors(); |
532 |
} |
533 |
|
534 |
public String getDescription() { |
535 |
return null; |
536 |
} |
537 |
|
538 |
public DynField getDynField(String name) { |
539 |
return (DynField) getAttributeDescriptor(name);
|
540 |
} |
541 |
|
542 |
public DynField[] getDynFields() { |
543 |
return (DynField[]) getAttributeDescriptors(); |
544 |
} |
545 |
|
546 |
public String getName() { |
547 |
return this.id + "_" + internalID; |
548 |
} |
549 |
|
550 |
public void removeDynField(String name) { |
551 |
throw new UnsupportedOperationException(); |
552 |
|
553 |
} |
554 |
|
555 |
public void addDynMethod(DynMethod dynMethod) { |
556 |
throw new UnsupportedOperationException(); |
557 |
|
558 |
} |
559 |
|
560 |
public void extend(DynClass dynClass) { |
561 |
throw new UnsupportedOperationException(); |
562 |
|
563 |
} |
564 |
|
565 |
public void extend(String dynClassName) { |
566 |
throw new UnsupportedOperationException(); |
567 |
|
568 |
} |
569 |
|
570 |
public void extend(String namespace, String dynClassName) { |
571 |
throw new UnsupportedOperationException(); |
572 |
|
573 |
} |
574 |
|
575 |
public DynMethod getDeclaredDynMethod(String name) |
576 |
throws DynMethodException {
|
577 |
return null; |
578 |
} |
579 |
|
580 |
public DynMethod[] getDeclaredDynMethods() throws DynMethodException { |
581 |
return null; |
582 |
} |
583 |
|
584 |
public DynMethod getDynMethod(String name) throws DynMethodException { |
585 |
return null; |
586 |
} |
587 |
|
588 |
public DynMethod getDynMethod(int code) throws DynMethodException { |
589 |
return null; |
590 |
} |
591 |
|
592 |
public DynMethod[] getDynMethods() throws DynMethodException { |
593 |
return null; |
594 |
} |
595 |
|
596 |
public DynClass[] getSuperDynClasses() { |
597 |
return null; |
598 |
} |
599 |
|
600 |
public boolean isInstance(DynObject dynObject) { |
601 |
if (dynObject.getDynClass().getName() == getName()) {
|
602 |
return true; |
603 |
} |
604 |
return false; |
605 |
} |
606 |
|
607 |
public DynObject newInstance() {
|
608 |
|
609 |
throw new UnsupportedOperationException(); |
610 |
} |
611 |
|
612 |
public void removeDynMethod(String name) { |
613 |
throw new UnsupportedOperationException(); |
614 |
|
615 |
} |
616 |
|
617 |
public DynField addDynFieldChoice(String name, int type, |
618 |
Object defaultValue, DynObjectValueItem[] values, |
619 |
boolean mandatory, boolean persistent) { |
620 |
throw new UnsupportedOperationException(); |
621 |
} |
622 |
|
623 |
public DynField addDynFieldRange(String name, int type, |
624 |
Object defaultValue, Object min, Object max, boolean mandatory, |
625 |
boolean persistent) {
|
626 |
throw new UnsupportedOperationException(); |
627 |
} |
628 |
|
629 |
public DynField addDynFieldSingle(String name, int type, |
630 |
Object defaultValue, boolean mandatory, boolean persistent) { |
631 |
throw new UnsupportedOperationException(); |
632 |
} |
633 |
|
634 |
public void validate(DynObject object) throws DynObjectValidateException { |
635 |
//FIXME: not sure it's the correct code
|
636 |
if (object instanceof Feature) { |
637 |
Feature fea = (Feature) object; |
638 |
if (fea.getType().equals(this)) { |
639 |
return;
|
640 |
} |
641 |
} |
642 |
throw new DynObjectValidateException(this.id); |
643 |
} |
644 |
|
645 |
public DynField addDynFieldLong(String name) { |
646 |
throw new UnsupportedOperationException(); |
647 |
} |
648 |
|
649 |
public DynField addDynFieldChoice(String name, int type, |
650 |
Object defaultValue, DynObjectValueItem[] values) { |
651 |
throw new UnsupportedOperationException(); |
652 |
} |
653 |
|
654 |
public DynField addDynFieldRange(String name, int type, |
655 |
Object defaultValue, Object min, Object max) { |
656 |
throw new UnsupportedOperationException(); |
657 |
} |
658 |
|
659 |
public DynField addDynFieldSingle(String name, int type, Object defaultValue) { |
660 |
throw new UnsupportedOperationException(); |
661 |
} |
662 |
|
663 |
public DynField addDynFieldString(String name) { |
664 |
throw new UnsupportedOperationException(); |
665 |
} |
666 |
|
667 |
public DynField addDynFieldInt(String name) { |
668 |
throw new UnsupportedOperationException(); |
669 |
} |
670 |
|
671 |
public DynField addDynFieldDouble(String name) { |
672 |
throw new UnsupportedOperationException(); |
673 |
} |
674 |
|
675 |
public DynField addDynFieldFloat(String name) { |
676 |
throw new UnsupportedOperationException(); |
677 |
} |
678 |
|
679 |
public DynField addDynFieldBoolean(String name) { |
680 |
throw new UnsupportedOperationException(); |
681 |
} |
682 |
|
683 |
public DynField addDynFieldList(String name) { |
684 |
throw new UnsupportedOperationException(); |
685 |
} |
686 |
|
687 |
public DynField addDynFieldMap(String name) { |
688 |
throw new UnsupportedOperationException(); |
689 |
} |
690 |
|
691 |
public DynField addDynFieldObject(String name) { |
692 |
throw new UnsupportedOperationException(); |
693 |
} |
694 |
|
695 |
public DynField addDynFieldSet(String name) { |
696 |
throw new UnsupportedOperationException(); |
697 |
} |
698 |
|
699 |
public DynField addDynFieldArray(String name) { |
700 |
throw new UnsupportedOperationException(); |
701 |
} |
702 |
|
703 |
public DynField addDynFieldDate(String name) { |
704 |
throw new UnsupportedOperationException(); |
705 |
} |
706 |
|
707 |
public void extend(DynStruct struct) { |
708 |
throw new UnsupportedOperationException(); |
709 |
} |
710 |
|
711 |
public String getFullName() { |
712 |
// TODO: usar el DynClassName
|
713 |
return this.id; |
714 |
} |
715 |
|
716 |
public String getNamespace() { |
717 |
return "DALFeature"; |
718 |
} |
719 |
|
720 |
public DynStruct[] getSuperDynStructs() { |
721 |
return null; |
722 |
} |
723 |
|
724 |
public void setDescription(String description) { |
725 |
throw new UnsupportedOperationException(); |
726 |
} |
727 |
|
728 |
public void setNamespace(String namespace) { |
729 |
throw new UnsupportedOperationException(); |
730 |
} |
731 |
|
732 |
public DynField addDynFieldFile(String name) { |
733 |
throw new UnsupportedOperationException(); |
734 |
} |
735 |
|
736 |
public DynField addDynFieldFolder(String name) { |
737 |
throw new UnsupportedOperationException(); |
738 |
} |
739 |
|
740 |
public DynField addDynFieldURL(String name) { |
741 |
throw new UnsupportedOperationException(); |
742 |
} |
743 |
|
744 |
public DynField addDynFieldURI(String name) { |
745 |
throw new UnsupportedOperationException(); |
746 |
} |
747 |
|
748 |
public boolean isExtendable(DynStruct dynStruct) { |
749 |
return false; |
750 |
} |
751 |
|
752 |
public void extend(DynStruct[] structs) { |
753 |
// TODO Auto-generated method stub
|
754 |
|
755 |
} |
756 |
|
757 |
public void remove(DynStruct superDynStruct) { |
758 |
// TODO Auto-generated method stub
|
759 |
|
760 |
} |
761 |
|
762 |
public void removeAll(DynStruct[] superDynStruct) { |
763 |
// TODO Auto-generated method stub
|
764 |
|
765 |
} |
766 |
|
767 |
public FeatureAttributeDescriptor getDefaultTimeAttribute() {
|
768 |
if (this.defaultTimeAttributeIndex < 0) { |
769 |
return null; |
770 |
} |
771 |
return (FeatureAttributeDescriptor) super |
772 |
.get(this.defaultTimeAttributeIndex);
|
773 |
} |
774 |
} |