Revision 45739 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/Feature.java
Feature.java | ||
---|---|---|
46 | 46 |
* in a data base table. In SIG domain, a Feature is a compound data structure |
47 | 47 |
* that may contain a geographic component. The conventional term Feature comes |
48 | 48 |
* from the term cartographic feature and both represent the same concept. |
49 |
* </p> |
|
50 | 49 |
* <p> |
51 | 50 |
* A Feature may contain more than one geometry attribute. In the case there is |
52 | 51 |
* not any geometry data, the <code>getDefaultGeometry()</code> will return |
53 | 52 |
* <code>null</code>. |
54 |
* </p> |
|
55 | 53 |
* <p> |
56 | 54 |
* Features are not editable as such. To edit a Feature you have to obtain an |
57 | 55 |
* editable instance <code>EditableFeature</code> using the method |
58 | 56 |
* <code>getEditable()</code>. Modify that editable instance and then apply the |
59 | 57 |
* changes to the Feature. This mechanism is to avoid ambiguity and loosing |
60 | 58 |
* track on the Feature internal state. |
61 |
* </p> |
|
62 | 59 |
* <br> |
63 | 60 |
* <p> |
64 | 61 |
* The Feature: |
65 | 62 |
* <ul> |
66 | 63 |
* <li>Has an unique identifier <code>FeatureReference</code> to recognize our |
67 |
* Feature from each other from the same data store</li>
|
|
64 |
* Feature from each other from the same data store |
|
68 | 65 |
* <li>Has a <code>FeatureType</code> that describes the Feature characteristics |
69 |
* (attributes, data types, default geometry, validation rules).</li>
|
|
70 |
* <li>Can obtain a copy of itself.</li>
|
|
66 |
* (attributes, data types, default geometry, validation rules). |
|
67 |
* <li>Can obtain a copy of itself. |
|
71 | 68 |
* <li>Can obtain its default geometry attribute and also a list with all the |
72 |
* geometry attributes.</li>
|
|
69 |
* geometry attributes. |
|
73 | 70 |
* <li>Can obtain its default Spatial Reference System and also a list with all |
74 |
* the SRSs used in the geometry attributes.</li>
|
|
71 |
* the SRSs used in the geometry attributes. |
|
75 | 72 |
* <li>Can obtain the envelope (extent) of the default geometry attribute. |
76 |
* <li>Can obtain the editable instance of the Feature.</li>
|
|
73 |
* <li>Can obtain the editable instance of the Feature. |
|
77 | 74 |
* <li>Has a set of utility methods to read attributes when their type is known, |
78 |
* by both index and name.</li>
|
|
75 |
* by both index and name. |
|
79 | 76 |
* </ul> |
80 |
* </p> |
|
81 | 77 |
* |
82 | 78 |
*/ |
83 | 79 |
public interface Feature extends GetItemByKeyWithSizeAndGetKeys<String, Object>, SupportToJson { |
84 | 80 |
|
81 |
static final int CHECK_RULES_AT_EDITING = 1; |
|
82 |
static final int CHECK_RULES_AT_FINISH = 2; |
|
83 |
static final int CHECK_REQUIREDS = 4; |
|
84 |
static final int CHECK_BASIC = 8; |
|
85 |
|
|
85 | 86 |
/** |
86 | 87 |
* Returns a unique identifier for this Feature in the associated store. |
87 | 88 |
* |
... | ... | |
103 | 104 |
*/ |
104 | 105 |
public Feature getCopy(); |
105 | 106 |
|
107 |
public void validate(int mode) throws DataException; |
|
108 |
|
|
106 | 109 |
/** |
107 |
* Mode that indicates the validation of all FeatureRules |
|
108 |
*/ |
|
109 |
static final int ALL = 0; |
|
110 |
|
|
111 |
/** |
|
112 |
* Mode that indicates the validation of the update FeatureRules |
|
113 |
*/ |
|
114 |
static final int UPDATE = 1; |
|
115 |
|
|
116 |
/** |
|
117 |
* Mode that indicates the validation of the finish editing FeatureRules |
|
118 |
*/ |
|
119 |
static final int FINISH_EDITING = 2; |
|
120 |
|
|
121 |
/** |
|
122 |
* Validates this Feature by applying the <code>FeatureRules</code> |
|
123 |
* corresponding to the given mode. |
|
124 |
* |
|
125 |
* @param mode one of the constants {ALL, UPDATE, FINISH_EDITING} |
|
126 |
* @throws DataException on validation errors |
|
127 |
*/ |
|
128 |
public void validate(int mode) throws DataException; |
|
129 |
|
|
130 |
/** |
|
131 | 110 |
* Returns the editable instance of this Feature. EditableFeature offers |
132 | 111 |
* methods for Feature editing. |
133 | 112 |
* |
Also available in: Unified diff