Statistics
| Revision:

svn-gvsig-desktop / 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 @ 45425

History | View | Annotate | Download (9.14 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;
25

    
26
import java.text.DateFormat;
27
import java.util.Locale;
28
import org.cresques.cts.IProjection;
29
import org.gvsig.expressionevaluator.Expression;
30

    
31
import org.gvsig.fmap.dal.DataTypes;
32
import org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException;
33
import org.gvsig.fmap.geom.type.GeometryType;
34
import org.gvsig.json.SupportFromJson;
35
import org.gvsig.timesupport.Interval;
36
import org.gvsig.tools.dataTypes.DataType;
37
import org.gvsig.tools.evaluator.Evaluator;
38

    
39
/**
40
 * This interface represents a FeatureAttributeDescriptor in editable state. To
41
 * edit a FeatureAttributeDescriptor you have to obtain its instance of
42
 * EditableFeatureAttributeDescriptor and then perform editing operations on it.
43
 *
44
 * Once you have completed the editing you can save the changes to the original
45
 * FeatureAttributeDescriptor. This is the only way to edit a
46
 * FeatureAttributeDescriptor.
47
 */
48
public interface EditableFeatureAttributeDescriptor
49
        extends FeatureAttributeDescriptor, SupportFromJson {
50

    
51
  /**
52
   * Checks attribute integrity
53
   *
54
   * @throws
55
   * org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException
56
   */
57
  void checkIntegrity() throws AttributeFeatureTypeIntegrityException;
58

    
59
  @Override
60
  public EditableForeingKey getForeingKey();
61

    
62
  /**
63
   * Sets the name
64
   *
65
   * @param name to set
66
   * @return this
67
   */
68
  public EditableFeatureAttributeDescriptor setName(String name);
69

    
70
  /**
71
   * Sets the data type
72
   *
73
   * @param type one of the constants defined in {@link DataTypes}
74
   * @return this
75
   */
76
  public EditableFeatureAttributeDescriptor setDataType(int type);
77

    
78
  public EditableFeatureAttributeDescriptor setDataType(DataType dataType);
79

    
80
  public EditableFeatureAttributeDescriptor setDataProfileName(String dataProfile);
81

    
82
  /**
83
   * Sets the size.
84
   * Used for arrays (byte, char/string,...)
85
   *
86
   * @param size a size of type int
87
   * @return this
88
   *
89
   */
90
  public EditableFeatureAttributeDescriptor setSize(int size);
91

    
92
  /**
93
   * Set the required bytes to store this attribute.
94
   * 
95
   * This value is dependent of the store type.
96
   * 
97
   * @param size
98
   * @return 
99
   */
100
  public EditableFeatureAttributeDescriptor setDisplaySize(int size);
101
  
102
  /**
103
   * Sets the precision
104
   *
105
   * @param precision of type int
106
   *
107
   * @return this
108
   */
109
  public EditableFeatureAttributeDescriptor setPrecision(int precision);
110

    
111
  public EditableFeatureAttributeDescriptor setScale(int scale);
112

    
113
  /**
114
   * Sets the Class to which the related FeatureAttribute can be cast
115
   *
116
   * @param theClass Class to which the related FeatureAttribute can be cast
117
   * @return this
118
   */
119
  public EditableFeatureAttributeDescriptor setObjectClass(Class theClass);
120

    
121
  /**
122
   * Sets the number of minimum occurrences
123
   *
124
   * @param minimumOccurrences
125
   *
126
   * @return this
127
   */
128
  public EditableFeatureAttributeDescriptor setMinimumOccurrences(
129
          int minimumOccurrences);
130

    
131
  /**
132
   * Sets the maximum number of occurrences
133
   *
134
   * @param maximumOccurrences
135
   *
136
   * @return
137
   */
138
  public EditableFeatureAttributeDescriptor setMaximumOccurrences(
139
          int maximumOccurrences);
140

    
141
  /**
142
   * Sets whether the related FeatureAttribute is part of the FeatureType's
143
   * primary key
144
   *
145
   * @param isPrimaryKey true if is part of the primary key
146
   * @return this
147
   */
148
  public EditableFeatureAttributeDescriptor setIsPrimaryKey(
149
          boolean isPrimaryKey);
150

    
151
  /**
152
   * Sets the expression evaluator that the FeatureAttribute will use
153
   *
154
   * @param evaluator an implementation of DAL's Evaluator interface
155
   * @return this
156
   */
157
  public EditableFeatureAttributeDescriptor setEvaluator(Evaluator evaluator);
158

    
159
  public EditableFeatureAttributeDescriptor setAvoidCachingAvailableValues(boolean avoidCachingAvailableValues);
160
  
161
  /**
162
   * Sets the {@link FeatureAttributeEmulator} that is used to update the
163
   * presentation of a field.
164
   *
165
   * @param featureAttributeEmulator the {@link FeatureAttributeEmulator} to
166
   * set.
167
   * @return
168
   */
169
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator);
170

    
171
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression);
172

    
173
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(String expression);
174

    
175
  /**
176
   * Sets whether the related FeatureAttribute is read only
177
   *
178
   * @param isReadOnly
179
   *
180
   * @return this
181
   */
182
  public EditableFeatureAttributeDescriptor setIsReadOnly(boolean isReadOnly);
183

    
184
  /**
185
   * Sets whether the related FeatureAttribute can have a null value
186
   *
187
   * @param allowNull a boolean value determining whether the FeatureAttribute
188
   * can be null
189
   *
190
   * @return this
191
   */
192
  public EditableFeatureAttributeDescriptor setAllowNull(boolean allowNull);
193

    
194
  /**
195
   * Sets the SRS.
196
   *
197
   * @param SRS
198
   *
199
   * @return
200
   */
201
  public EditableFeatureAttributeDescriptor setSRS(IProjection SRS);
202

    
203
  public EditableFeatureAttributeDescriptor setSRS(String SRS);
204

    
205
  public EditableFeatureAttributeDescriptor setInterval(Interval interval);
206

    
207
  /**
208
   * Sets the geometry type
209
   *
210
   * @param geometryType
211
   *
212
   * @return this
213
   * @deprecated use {@link #setGeometryType(GeometryType)} instead
214
   */
215
  public EditableFeatureAttributeDescriptor setGeometryType(int geometryType);
216

    
217
  /**
218
   * Sets the geometry subtype
219
   *
220
   * @param geometrySubType
221
   *
222
   * @return this
223
   * @deprecated use {@link #setGeometryType(GeometryType)} instead
224
   */
225
  public EditableFeatureAttributeDescriptor setGeometrySubType(
226
          int geometrySubType);
227

    
228
  /**
229
   * Sets the geometry type
230
   *
231
   * @param geometryType
232
   *
233
   * @return this
234
   */
235
  public EditableFeatureAttributeDescriptor setGeometryType(
236
          GeometryType geometryType);
237

    
238
  /**
239
   * Sets the geometry type and subtype. The format is:
240
   * <code>{geometryType}{sep}[geometrySubtype}</code> where:
241
   * <ul>
242
   * <li>geometryType is the name of the type of geometry.</li>
243
   * <li>sep is a character from ":/-!;#@".</li>
244
   * <li>geometrySubtype is the name of the subtype of geometry.</li>
245
   * </ul>
246
   *
247
   * @param geometryType
248
   * @return
249
   */
250
  public EditableFeatureAttributeDescriptor setGeometryType(String geometryType);
251

    
252
  public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType);
253

    
254
  /**
255
   * Sets the default value
256
   *
257
   * @param defaultValue
258
   *
259
   * @return this
260
   */
261
  public EditableFeatureAttributeDescriptor setDefaultValue(
262
          Object defaultValue);
263

    
264
  /**
265
   * Sets additional information of the attribute
266
   *
267
   * @param infoName
268
   * @param value
269
   * @return
270
   */
271
  public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, String value);
272
  
273
  @Deprecated
274
  public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value);
275

    
276
  /**
277
   * Sets whether the related FeatureAttribute is part of the FeatureType's
278
   * primary key
279
   *
280
   * @param isAutomatic true if is part of the primary key
281
   * @return this
282
   */
283
  public EditableFeatureAttributeDescriptor setIsAutomatic(boolean isAutomatic);
284

    
285
  /**
286
   * Sets is the attribute is a temporal attribute.
287
   *
288
   * @param isTime <code>true</code> if the attribute is temporal
289
   * @return this
290
   */
291
  public EditableFeatureAttributeDescriptor setIsTime(boolean isTime);
292

    
293
  /**
294
   * Sets if this attribute is indexed in the table.
295
   *
296
   * @param isIndexed
297
   * @return this
298
   */
299
  public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed);
300

    
301
  public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds);
302

    
303
  public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending);
304

    
305
  /**
306
   * Returns the attribute descriptor's name before it was changed or null if
307
   * never changed
308
   *
309
   * @return
310
   */
311
  public String getOriginalName();
312

    
313
  /**
314
   * If this attribute is of type Date, then this method set the date format set
315
   * by the data store.
316
   *
317
   * @param dateFormat
318
   * @return
319
   */
320
  public EditableFeatureAttributeDescriptor setDateFormat(DateFormat dateFormat);
321

    
322
  public EditableFeatureAttributeDescriptor set(String name, Object value);
323

    
324
  public EditableFeatureAttributeDescriptor setRoundMode(int roundMode);
325

    
326
  public EditableFeatureAttributeDescriptor setLocale(Locale locale);
327

    
328
}