Revision 30187 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
DefaultFeatureType.java | ||
---|---|---|
14 | 14 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
15 | 15 |
import org.gvsig.fmap.dal.feature.FeatureRules; |
16 | 16 |
import org.gvsig.fmap.dal.feature.FeatureType; |
17 |
import org.gvsig.tools.dynobject.DynClass; |
|
18 |
import org.gvsig.tools.dynobject.DynField; |
|
19 |
import org.gvsig.tools.dynobject.DynMethod; |
|
20 |
import org.gvsig.tools.dynobject.DynObject; |
|
21 |
import org.gvsig.tools.dynobject.DynObjectValueItem; |
|
22 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
|
23 |
import org.gvsig.tools.dynobject.exception.DynObjectValidateException; |
|
17 | 24 |
|
18 | 25 |
public class DefaultFeatureType extends ArrayList implements FeatureType { |
19 | 26 |
|
... | ... | |
363 | 370 |
return (FeatureAttributeDescriptor) super |
364 | 371 |
.get(this.defaultGeometryAttributeIndex); |
365 | 372 |
} |
373 |
|
|
366 | 374 |
|
367 | 375 |
|
368 | 376 |
public boolean equals(Object other) { |
... | ... | |
403 | 411 |
|
404 | 412 |
} |
405 | 413 |
|
414 |
/** |
|
415 |
* Start of DynClass interface implementation |
|
416 |
* READONLY |
|
417 |
*/ |
|
418 |
|
|
419 |
public DynField addDynField(String name) { |
|
420 |
throw new UnsupportedOperationException(); |
|
421 |
} |
|
422 |
|
|
423 |
public DynField getDeclaredDynField(String name) { |
|
424 |
return getAttributeDescriptor(name); |
|
425 |
} |
|
426 |
|
|
427 |
public DynField[] getDeclaredDynFields() { |
|
428 |
return getAttributeDescriptors(); |
|
429 |
} |
|
430 |
|
|
431 |
public String getDescription() { |
|
432 |
// TODO Auto-generated method stub |
|
433 |
return null; |
|
434 |
} |
|
435 |
|
|
436 |
public DynField getDynField(String name) { |
|
437 |
return getAttributeDescriptor(name); |
|
438 |
} |
|
439 |
|
|
440 |
public DynField[] getDynFields() { |
|
441 |
return getAttributeDescriptors(); |
|
442 |
} |
|
443 |
|
|
444 |
public String getName() { |
|
445 |
return Long.toString(serialVersionUID); |
|
446 |
} |
|
447 |
|
|
448 |
public void removeDynField(String name) { |
|
449 |
throw new UnsupportedOperationException(); |
|
450 |
|
|
451 |
} |
|
452 |
|
|
453 |
public void addDynMethod(DynMethod dynMethod) { |
|
454 |
throw new UnsupportedOperationException(); |
|
455 |
|
|
456 |
} |
|
457 |
|
|
458 |
public void extend(DynClass dynClass) { |
|
459 |
throw new UnsupportedOperationException(); |
|
460 |
|
|
461 |
} |
|
462 |
|
|
463 |
public void extend(String dynClassName) { |
|
464 |
throw new UnsupportedOperationException(); |
|
465 |
|
|
466 |
} |
|
467 |
|
|
468 |
public DynMethod getDeclaredDynMethod(String name) |
|
469 |
throws DynMethodException { |
|
470 |
// TODO Auto-generated method stub |
|
471 |
return null; |
|
472 |
} |
|
473 |
|
|
474 |
public DynMethod[] getDeclaredDynMethods() throws DynMethodException { |
|
475 |
// TODO Auto-generated method stub |
|
476 |
return null; |
|
477 |
} |
|
478 |
|
|
479 |
public DynMethod getDynMethod(String name) throws DynMethodException { |
|
480 |
// TODO Auto-generated method stub |
|
481 |
return null; |
|
482 |
} |
|
483 |
|
|
484 |
public DynMethod getDynMethod(int code) throws DynMethodException { |
|
485 |
// TODO Auto-generated method stub |
|
486 |
return null; |
|
487 |
} |
|
488 |
|
|
489 |
public DynMethod[] getDynMethods() throws DynMethodException { |
|
490 |
// TODO Auto-generated method stub |
|
491 |
return null; |
|
492 |
} |
|
493 |
|
|
494 |
public DynClass[] getSuperDynClasses() { |
|
495 |
// TODO Auto-generated method stub |
|
496 |
return null; |
|
497 |
} |
|
498 |
|
|
499 |
public boolean isInstance(DynObject dynObject) { |
|
500 |
if (dynObject.getDynClass().getName() == getName()) |
|
501 |
return true; |
|
502 |
return false; |
|
503 |
} |
|
504 |
|
|
505 |
public DynObject newInstance() { |
|
506 |
|
|
507 |
throw new UnsupportedOperationException(); |
|
508 |
} |
|
509 |
|
|
510 |
public void removeDynMethod(String name) { |
|
511 |
throw new UnsupportedOperationException(); |
|
512 |
|
|
513 |
} |
|
514 |
|
|
515 |
public DynField addDynFieldChoice(String name, int type, |
|
516 |
Object defaultValue, DynObjectValueItem[] values, |
|
517 |
boolean mandatory, boolean persistent) { |
|
518 |
throw new UnsupportedOperationException(); |
|
519 |
} |
|
520 |
|
|
521 |
public DynField addDynFieldRange(String name, int type, |
|
522 |
Object defaultValue, Object min, Object max, boolean mandatory, |
|
523 |
boolean persistent) { |
|
524 |
throw new UnsupportedOperationException(); |
|
525 |
} |
|
526 |
|
|
527 |
public DynField addDynFieldSingle(String name, int type, |
|
528 |
Object defaultValue, boolean mandatory, boolean persistent) { |
|
529 |
throw new UnsupportedOperationException(); |
|
530 |
} |
|
531 |
|
|
532 |
public void validate(DynObject object) throws DynObjectValidateException { |
|
533 |
//FIXME: not sure it's the correct code |
|
534 |
if (object instanceof Feature) { |
|
535 |
Feature fea = (Feature) object; |
|
536 |
if (fea.getType().equals(this)) |
|
537 |
return; |
|
538 |
} |
|
539 |
throw new DynObjectValidateException( |
|
540 |
"The object is not a Feature or is not this FeatureType", |
|
541 |
"NOT_THIS_FEATURE_TYPE", -1); |
|
542 |
} |
|
543 |
|
|
544 |
|
|
545 |
|
|
406 | 546 |
} |
Also available in: Unified diff