Revision 44673 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/EditableFeatureAttributeDescriptor.java
EditableFeatureAttributeDescriptor.java | ||
---|---|---|
24 | 24 |
package org.gvsig.fmap.dal.feature; |
25 | 25 |
|
26 | 26 |
import java.text.DateFormat; |
27 |
import java.util.Locale; |
|
27 | 28 |
import org.cresques.cts.IProjection; |
28 | 29 |
import org.gvsig.expressionevaluator.Expression; |
29 | 30 |
|
... | ... | |
35 | 36 |
import org.gvsig.tools.evaluator.Evaluator; |
36 | 37 |
|
37 | 38 |
/** |
38 |
* This interface represents a FeatureAttributeDescriptor in editable state. |
|
39 |
* To edit a FeatureAttributeDescriptor you have to obtain its instance of
|
|
39 |
* This interface represents a FeatureAttributeDescriptor in editable state. To
|
|
40 |
* edit a FeatureAttributeDescriptor you have to obtain its instance of |
|
40 | 41 |
* EditableFeatureAttributeDescriptor and then perform editing operations on it. |
41 | 42 |
* |
42 | 43 |
* Once you have completed the editing you can save the changes to the original |
43 |
* FeatureAttributeDescriptor. This is the only way to edit a FeatureAttributeDescriptor. |
|
44 |
* FeatureAttributeDescriptor. This is the only way to edit a |
|
45 |
* FeatureAttributeDescriptor. |
|
44 | 46 |
*/ |
45 |
public interface EditableFeatureAttributeDescriptor |
|
46 |
extends FeatureAttributeDescriptor |
|
47 |
{ |
|
47 |
public interface EditableFeatureAttributeDescriptor |
|
48 |
extends FeatureAttributeDescriptor { |
|
48 | 49 |
|
49 |
/** |
|
50 |
* Checks attribute integrity |
|
51 |
* @throws org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException |
|
52 |
*/ |
|
53 |
void checkIntegrity() throws AttributeFeatureTypeIntegrityException; |
|
50 |
/** |
|
51 |
* Checks attribute integrity |
|
52 |
* |
|
53 |
* @throws |
|
54 |
* org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException |
|
55 |
*/ |
|
56 |
void checkIntegrity() throws AttributeFeatureTypeIntegrityException; |
|
54 | 57 |
|
55 |
@Override |
|
56 |
public EditableForeingKey getForeingKey(); |
|
57 |
|
|
58 |
/** |
|
59 |
* Sets the name |
|
60 |
* @param |
|
61 |
* name to set |
|
62 |
* @return this |
|
63 |
*/ |
|
64 |
public EditableFeatureAttributeDescriptor setName(String name); |
|
58 |
@Override |
|
59 |
public EditableForeingKey getForeingKey(); |
|
65 | 60 |
|
66 |
/**
|
|
67 |
* Sets the data type
|
|
68 |
* @param
|
|
69 |
* type one of the constants defined in {@link DataTypes}
|
|
70 |
* @return this
|
|
71 |
*/
|
|
72 |
public EditableFeatureAttributeDescriptor setDataType(int type);
|
|
61 |
/**
|
|
62 |
* Sets the name
|
|
63 |
*
|
|
64 |
* @param name to set
|
|
65 |
* @return this
|
|
66 |
*/
|
|
67 |
public EditableFeatureAttributeDescriptor setName(String name);
|
|
73 | 68 |
|
74 |
public EditableFeatureAttributeDescriptor setDataType(DataType dataType); |
|
69 |
/** |
|
70 |
* Sets the data type |
|
71 |
* |
|
72 |
* @param type one of the constants defined in {@link DataTypes} |
|
73 |
* @return this |
|
74 |
*/ |
|
75 |
public EditableFeatureAttributeDescriptor setDataType(int type); |
|
75 | 76 |
|
76 |
public EditableFeatureAttributeDescriptor setDataProfileName(String dataProfile); |
|
77 |
|
|
78 |
/** |
|
79 |
* Sets the size |
|
80 |
* @param size |
|
81 |
* a size of type int |
|
82 |
* @return this |
|
83 |
* |
|
84 |
*/ |
|
85 |
public EditableFeatureAttributeDescriptor setSize(int size); |
|
77 |
public EditableFeatureAttributeDescriptor setDataType(DataType dataType); |
|
86 | 78 |
|
87 |
/** |
|
88 |
* Sets the precision |
|
89 |
* |
|
90 |
* @param |
|
91 |
* precision of type int |
|
92 |
* |
|
93 |
* @return this |
|
94 |
*/ |
|
95 |
public EditableFeatureAttributeDescriptor setPrecision(int precision); |
|
79 |
public EditableFeatureAttributeDescriptor setDataProfileName(String dataProfile); |
|
96 | 80 |
|
97 |
public EditableFeatureAttributeDescriptor setScale(int scale); |
|
98 |
|
|
99 |
/** |
|
100 |
* Sets the Class to which the related FeatureAttribute can be cast |
|
101 |
* |
|
102 |
* @param theClass |
|
103 |
* Class to which the related FeatureAttribute can be cast |
|
104 |
* @return this |
|
105 |
*/ |
|
106 |
public EditableFeatureAttributeDescriptor setObjectClass(Class theClass); |
|
81 |
/** |
|
82 |
* Sets the size |
|
83 |
* |
|
84 |
* @param size a size of type int |
|
85 |
* @return this |
|
86 |
* |
|
87 |
*/ |
|
88 |
public EditableFeatureAttributeDescriptor setSize(int size); |
|
107 | 89 |
|
108 |
/** |
|
109 |
* Sets the number of minimum occurrences |
|
110 |
* |
|
111 |
* @param minimumOccurrences |
|
112 |
* |
|
113 |
* @return this |
|
114 |
*/ |
|
115 |
public EditableFeatureAttributeDescriptor setMinimumOccurrences( |
|
116 |
int minimumOccurrences); |
|
90 |
/** |
|
91 |
* Sets the precision |
|
92 |
* |
|
93 |
* @param precision of type int |
|
94 |
* |
|
95 |
* @return this |
|
96 |
*/ |
|
97 |
public EditableFeatureAttributeDescriptor setPrecision(int precision); |
|
117 | 98 |
|
118 |
/** |
|
119 |
* Sets the maximum number of occurrences |
|
120 |
* |
|
121 |
* @param maximumOccurrences |
|
122 |
* |
|
123 |
* @return |
|
124 |
*/ |
|
125 |
public EditableFeatureAttributeDescriptor setMaximumOccurrences( |
|
126 |
int maximumOccurrences); |
|
99 |
public EditableFeatureAttributeDescriptor setScale(int scale); |
|
127 | 100 |
|
128 |
/** |
|
129 |
* Sets whether the related FeatureAttribute is part of the FeatureType's primary key |
|
130 |
* |
|
131 |
* @param isPrimaryKey |
|
132 |
* true if is part of the primary key |
|
133 |
* @return this |
|
134 |
*/ |
|
135 |
public EditableFeatureAttributeDescriptor setIsPrimaryKey( |
|
136 |
boolean isPrimaryKey); |
|
101 |
/** |
|
102 |
* Sets the Class to which the related FeatureAttribute can be cast |
|
103 |
* |
|
104 |
* @param theClass Class to which the related FeatureAttribute can be cast |
|
105 |
* @return this |
|
106 |
*/ |
|
107 |
public EditableFeatureAttributeDescriptor setObjectClass(Class theClass); |
|
137 | 108 |
|
138 |
/** |
|
139 |
* Sets the expression evaluator that the FeatureAttribute will use |
|
140 |
* @param evaluator |
|
141 |
* an implementation of DAL's Evaluator interface |
|
142 |
* @return this |
|
143 |
*/ |
|
144 |
public EditableFeatureAttributeDescriptor setEvaluator(Evaluator evaluator); |
|
109 |
/** |
|
110 |
* Sets the number of minimum occurrences |
|
111 |
* |
|
112 |
* @param minimumOccurrences |
|
113 |
* |
|
114 |
* @return this |
|
115 |
*/ |
|
116 |
public EditableFeatureAttributeDescriptor setMinimumOccurrences( |
|
117 |
int minimumOccurrences); |
|
145 | 118 |
|
146 |
/** |
|
147 |
* Sets the {@link FeatureAttributeEmulator} that is used to update the |
|
148 |
* presentation of a field. |
|
149 |
* @param featureAttributeEmulator |
|
150 |
* the {@link FeatureAttributeEmulator} to set. |
|
151 |
* @return |
|
152 |
*/ |
|
153 |
public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator); |
|
119 |
/** |
|
120 |
* Sets the maximum number of occurrences |
|
121 |
* |
|
122 |
* @param maximumOccurrences |
|
123 |
* |
|
124 |
* @return |
|
125 |
*/ |
|
126 |
public EditableFeatureAttributeDescriptor setMaximumOccurrences( |
|
127 |
int maximumOccurrences); |
|
154 | 128 |
|
155 |
public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression); |
|
129 |
/** |
|
130 |
* Sets whether the related FeatureAttribute is part of the FeatureType's |
|
131 |
* primary key |
|
132 |
* |
|
133 |
* @param isPrimaryKey true if is part of the primary key |
|
134 |
* @return this |
|
135 |
*/ |
|
136 |
public EditableFeatureAttributeDescriptor setIsPrimaryKey( |
|
137 |
boolean isPrimaryKey); |
|
156 | 138 |
|
157 |
public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(String expression); |
|
158 |
|
|
159 |
/** |
|
160 |
* Sets whether the related FeatureAttribute is read only |
|
161 |
* |
|
162 |
* @param isReadOnly |
|
163 |
* |
|
164 |
* @return this |
|
165 |
*/ |
|
166 |
public EditableFeatureAttributeDescriptor setIsReadOnly(boolean isReadOnly); |
|
139 |
/** |
|
140 |
* Sets the expression evaluator that the FeatureAttribute will use |
|
141 |
* |
|
142 |
* @param evaluator an implementation of DAL's Evaluator interface |
|
143 |
* @return this |
|
144 |
*/ |
|
145 |
public EditableFeatureAttributeDescriptor setEvaluator(Evaluator evaluator); |
|
167 | 146 |
|
168 |
/**
|
|
169 |
* Sets whether the related FeatureAttribute can have a null value
|
|
170 |
*
|
|
171 |
* @param allowNull
|
|
172 |
* a boolean value determining whether the FeatureAttribute can be null
|
|
173 |
*
|
|
174 |
* @return this
|
|
175 |
*/
|
|
176 |
public EditableFeatureAttributeDescriptor setAllowNull(boolean allowNull);
|
|
147 |
/**
|
|
148 |
* Sets the {@link FeatureAttributeEmulator} that is used to update the
|
|
149 |
* presentation of a field.
|
|
150 |
*
|
|
151 |
* @param featureAttributeEmulator the {@link FeatureAttributeEmulator} to
|
|
152 |
* set.
|
|
153 |
* @return
|
|
154 |
*/
|
|
155 |
public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator);
|
|
177 | 156 |
|
178 |
/** |
|
179 |
* Sets the SRS. |
|
180 |
* |
|
181 |
* @param SRS |
|
182 |
* |
|
183 |
* @return |
|
184 |
*/ |
|
185 |
public EditableFeatureAttributeDescriptor setSRS(IProjection SRS); |
|
157 |
public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression); |
|
186 | 158 |
|
187 |
public EditableFeatureAttributeDescriptor setSRS(String SRS); |
|
188 |
|
|
189 |
public EditableFeatureAttributeDescriptor setInterval(Interval interval); |
|
190 |
|
|
191 |
/** |
|
192 |
* Sets the geometry type |
|
193 |
* |
|
194 |
* @param geometryType |
|
195 |
* |
|
196 |
* @return this |
|
197 |
* @deprecated use {@link #setGeometryType(GeometryType)} instead |
|
198 |
*/ |
|
199 |
public EditableFeatureAttributeDescriptor setGeometryType(int geometryType); |
|
159 |
public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(String expression); |
|
200 | 160 |
|
201 |
/** |
|
202 |
* Sets the geometry subtype |
|
203 |
* |
|
204 |
* @param geometrySubType |
|
205 |
* |
|
206 |
* @return this |
|
207 |
* @deprecated use {@link #setGeometryType(GeometryType)} instead |
|
208 |
*/ |
|
209 |
public EditableFeatureAttributeDescriptor setGeometrySubType( |
|
210 |
int geometrySubType); |
|
161 |
/** |
|
162 |
* Sets whether the related FeatureAttribute is read only |
|
163 |
* |
|
164 |
* @param isReadOnly |
|
165 |
* |
|
166 |
* @return this |
|
167 |
*/ |
|
168 |
public EditableFeatureAttributeDescriptor setIsReadOnly(boolean isReadOnly); |
|
211 | 169 |
|
212 |
/** |
|
213 |
* Sets the geometry type |
|
214 |
* |
|
215 |
* @param geometryType |
|
216 |
* |
|
217 |
* @return this |
|
218 |
*/ |
|
219 |
public EditableFeatureAttributeDescriptor setGeometryType( |
|
220 |
GeometryType geometryType); |
|
221 |
|
|
222 |
/** |
|
223 |
* Sets the geometry type and subtype. The format is: |
|
224 |
* <code>{geometryType}{sep}[geometrySubtype}</code> where: |
|
225 |
* <ul> |
|
226 |
* <li>geometryType is the name of the type of geometry.</li> |
|
227 |
* <li>sep is a character from ":/-!;#@".</li> |
|
228 |
* <li>geometrySubtype is the name of the subtype of geometry.</li> |
|
229 |
* </ul> |
|
230 |
* |
|
231 |
* @param geometryType |
|
232 |
* @return |
|
233 |
*/ |
|
234 |
public EditableFeatureAttributeDescriptor setGeometryType(String geometryType); |
|
170 |
/** |
|
171 |
* Sets whether the related FeatureAttribute can have a null value |
|
172 |
* |
|
173 |
* @param allowNull a boolean value determining whether the FeatureAttribute |
|
174 |
* can be null |
|
175 |
* |
|
176 |
* @return this |
|
177 |
*/ |
|
178 |
public EditableFeatureAttributeDescriptor setAllowNull(boolean allowNull); |
|
235 | 179 |
|
236 |
public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType); |
|
180 |
/** |
|
181 |
* Sets the SRS. |
|
182 |
* |
|
183 |
* @param SRS |
|
184 |
* |
|
185 |
* @return |
|
186 |
*/ |
|
187 |
public EditableFeatureAttributeDescriptor setSRS(IProjection SRS); |
|
237 | 188 |
|
238 |
/** |
|
239 |
* Sets the default value |
|
240 |
* |
|
241 |
* @param defaultValue |
|
242 |
* |
|
243 |
* @return this |
|
244 |
*/ |
|
245 |
public EditableFeatureAttributeDescriptor setDefaultValue( |
|
246 |
Object defaultValue); |
|
247 |
|
|
248 |
/** |
|
249 |
* Sets additional information of the attribute |
|
250 |
* @param infoName |
|
251 |
* @param value |
|
252 |
* @return |
|
253 |
*/ |
|
254 |
public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value); |
|
189 |
public EditableFeatureAttributeDescriptor setSRS(String SRS); |
|
255 | 190 |
|
256 |
/** |
|
257 |
* Sets whether the related FeatureAttribute is part of the FeatureType's |
|
258 |
* primary key |
|
259 |
* |
|
260 |
* @param isAutomatic true if is part of the primary key |
|
261 |
* @return this |
|
262 |
*/ |
|
263 |
public EditableFeatureAttributeDescriptor setIsAutomatic(boolean isAutomatic); |
|
191 |
public EditableFeatureAttributeDescriptor setInterval(Interval interval); |
|
264 | 192 |
|
265 |
/** |
|
266 |
* Sets is the attribute is a temporal attribute. |
|
267 |
* |
|
268 |
* @param isTime |
|
269 |
* <code>true</code> if the attribute is temporal |
|
270 |
* @return |
|
271 |
* this |
|
272 |
*/ |
|
273 |
public EditableFeatureAttributeDescriptor setIsTime(boolean isTime); |
|
274 |
|
|
275 |
/** |
|
276 |
* Sets if this attribute is indexed in the table. |
|
277 |
* @param isIndexed |
|
278 |
* @return this |
|
279 |
*/ |
|
280 |
public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed); |
|
281 |
|
|
282 |
public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds); |
|
283 |
|
|
284 |
public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending); |
|
285 |
|
|
286 |
/** |
|
287 |
* Returns the attribute descriptor's name before |
|
288 |
* it was changed or null if never changed |
|
289 |
* @return |
|
290 |
*/ |
|
291 |
public String getOriginalName(); |
|
292 |
|
|
293 |
/** |
|
294 |
* If this attribute is of type Date, then this method set |
|
295 |
* the date format set by the data store. |
|
296 |
* |
|
297 |
* @param dateFormat |
|
298 |
* @return |
|
299 |
*/ |
|
300 |
public EditableFeatureAttributeDescriptor setDateFormat(DateFormat dateFormat); |
|
193 |
/** |
|
194 |
* Sets the geometry type |
|
195 |
* |
|
196 |
* @param geometryType |
|
197 |
* |
|
198 |
* @return this |
|
199 |
* @deprecated use {@link #setGeometryType(GeometryType)} instead |
|
200 |
*/ |
|
201 |
public EditableFeatureAttributeDescriptor setGeometryType(int geometryType); |
|
301 | 202 |
|
302 |
public EditableFeatureAttributeDescriptor set(String name, Object value); |
|
203 |
/** |
|
204 |
* Sets the geometry subtype |
|
205 |
* |
|
206 |
* @param geometrySubType |
|
207 |
* |
|
208 |
* @return this |
|
209 |
* @deprecated use {@link #setGeometryType(GeometryType)} instead |
|
210 |
*/ |
|
211 |
public EditableFeatureAttributeDescriptor setGeometrySubType( |
|
212 |
int geometrySubType); |
|
213 |
|
|
214 |
/** |
|
215 |
* Sets the geometry type |
|
216 |
* |
|
217 |
* @param geometryType |
|
218 |
* |
|
219 |
* @return this |
|
220 |
*/ |
|
221 |
public EditableFeatureAttributeDescriptor setGeometryType( |
|
222 |
GeometryType geometryType); |
|
223 |
|
|
224 |
/** |
|
225 |
* Sets the geometry type and subtype. The format is: |
|
226 |
* <code>{geometryType}{sep}[geometrySubtype}</code> where: |
|
227 |
* <ul> |
|
228 |
* <li>geometryType is the name of the type of geometry.</li> |
|
229 |
* <li>sep is a character from ":/-!;#@".</li> |
|
230 |
* <li>geometrySubtype is the name of the subtype of geometry.</li> |
|
231 |
* </ul> |
|
232 |
* |
|
233 |
* @param geometryType |
|
234 |
* @return |
|
235 |
*/ |
|
236 |
public EditableFeatureAttributeDescriptor setGeometryType(String geometryType); |
|
237 |
|
|
238 |
public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType); |
|
239 |
|
|
240 |
/** |
|
241 |
* Sets the default value |
|
242 |
* |
|
243 |
* @param defaultValue |
|
244 |
* |
|
245 |
* @return this |
|
246 |
*/ |
|
247 |
public EditableFeatureAttributeDescriptor setDefaultValue( |
|
248 |
Object defaultValue); |
|
249 |
|
|
250 |
/** |
|
251 |
* Sets additional information of the attribute |
|
252 |
* |
|
253 |
* @param infoName |
|
254 |
* @param value |
|
255 |
* @return |
|
256 |
*/ |
|
257 |
public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value); |
|
258 |
|
|
259 |
/** |
|
260 |
* Sets whether the related FeatureAttribute is part of the FeatureType's |
|
261 |
* primary key |
|
262 |
* |
|
263 |
* @param isAutomatic true if is part of the primary key |
|
264 |
* @return this |
|
265 |
*/ |
|
266 |
public EditableFeatureAttributeDescriptor setIsAutomatic(boolean isAutomatic); |
|
267 |
|
|
268 |
/** |
|
269 |
* Sets is the attribute is a temporal attribute. |
|
270 |
* |
|
271 |
* @param isTime <code>true</code> if the attribute is temporal |
|
272 |
* @return this |
|
273 |
*/ |
|
274 |
public EditableFeatureAttributeDescriptor setIsTime(boolean isTime); |
|
275 |
|
|
276 |
/** |
|
277 |
* Sets if this attribute is indexed in the table. |
|
278 |
* |
|
279 |
* @param isIndexed |
|
280 |
* @return this |
|
281 |
*/ |
|
282 |
public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed); |
|
283 |
|
|
284 |
public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds); |
|
285 |
|
|
286 |
public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending); |
|
287 |
|
|
288 |
/** |
|
289 |
* Returns the attribute descriptor's name before it was changed or null if |
|
290 |
* never changed |
|
291 |
* |
|
292 |
* @return |
|
293 |
*/ |
|
294 |
public String getOriginalName(); |
|
295 |
|
|
296 |
/** |
|
297 |
* If this attribute is of type Date, then this method set the date format set |
|
298 |
* by the data store. |
|
299 |
* |
|
300 |
* @param dateFormat |
|
301 |
* @return |
|
302 |
*/ |
|
303 |
public EditableFeatureAttributeDescriptor setDateFormat(DateFormat dateFormat); |
|
304 |
|
|
305 |
public EditableFeatureAttributeDescriptor set(String name, Object value); |
|
306 |
|
|
307 |
public EditableFeatureAttributeDescriptor setRoundMode(int roundMode); |
|
308 |
|
|
309 |
public EditableFeatureAttributeDescriptor setLocale(Locale locale); |
|
310 |
|
|
303 | 311 |
} |
Also available in: Unified diff