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 @ 44262

History | View | Annotate | Download (8.24 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 org.cresques.cts.IProjection;
28
import org.gvsig.expressionevaluator.Expression;
29

    
30
import org.gvsig.fmap.dal.DataTypes;
31
import org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException;
32
import org.gvsig.fmap.geom.type.GeometryType;
33
import org.gvsig.timesupport.Interval;
34
import org.gvsig.tools.dynobject.DynField;
35
import org.gvsig.tools.evaluator.Evaluator;
36

    
37
/**
38
 * This interface represents a FeatureAttributeDescriptor in editable state.
39
 * To edit a FeatureAttributeDescriptor you have to obtain its instance of
40
 * EditableFeatureAttributeDescriptor and then perform editing operations on it.
41
 *
42
 * 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
 */
45
public interface EditableFeatureAttributeDescriptor extends
46
                FeatureAttributeDescriptor {
47

    
48
        /**
49
         * Checks attribute integrity
50
         */
51
        void checkIntegrity() throws AttributeFeatureTypeIntegrityException;
52

    
53
        @Override
54
        public EditableForeingKey getForeingKey();
55
        
56
        /**
57
         * Sets the name
58
         * @param
59
         *                 name to set
60
         * @return this
61
         */
62
        public EditableFeatureAttributeDescriptor setName(String name);
63

    
64
        /**
65
         * Sets the data type
66
         * @param
67
         *                 type one of the constants defined in {@link DataTypes}
68
         * @return this
69
         */
70
        public EditableFeatureAttributeDescriptor setDataType(int type);
71

    
72
        public EditableFeatureAttributeDescriptor setDataProfileName(String dataProfile);
73
        
74
        /**
75
         * Sets the size
76
         * @param size
77
         *                         a size of type int
78
         * @return this
79
         *
80
         */
81
        public EditableFeatureAttributeDescriptor setSize(int size);
82

    
83
        /**
84
         * Sets the precision
85
         *
86
         * @param
87
         *                 precision of type int
88
         *
89
         * @return this
90
         */
91
        public EditableFeatureAttributeDescriptor setPrecision(int precision);
92

    
93
        /**
94
         * Sets the Class to which the related FeatureAttribute can be cast
95
         *
96
         * @param theClass
97
         *                                 Class to which the related FeatureAttribute can be cast
98
         * @return this
99
         */
100
        public EditableFeatureAttributeDescriptor setObjectClass(Class theClass);
101

    
102
        /**
103
         * Sets the number of minimum occurrences
104
         *
105
         * @param minimumOccurrences
106
         *
107
         * @return this
108
         */
109
        public EditableFeatureAttributeDescriptor setMinimumOccurrences(
110
                        int minimumOccurrences);
111

    
112
        /**
113
         * Sets the maximum number of occurrences
114
         *
115
         * @param maximumOccurrences
116
         *
117
         * @return
118
         */
119
        public EditableFeatureAttributeDescriptor setMaximumOccurrences(
120
                        int maximumOccurrences);
121

    
122
        /**
123
         * Sets whether the related FeatureAttribute is part of the FeatureType's primary key
124
         *
125
         * @param isPrimaryKey
126
         *                                 true if is part of the primary key
127
         * @return this
128
         */
129
        public EditableFeatureAttributeDescriptor setIsPrimaryKey(
130
                        boolean isPrimaryKey);
131

    
132
        /**
133
         * Sets the expression evaluator that the FeatureAttribute will use
134
         * @param evaluator
135
         *                                 an implementation of DAL's Evaluator interface
136
         * @return this
137
         */
138
        public EditableFeatureAttributeDescriptor setEvaluator(Evaluator evaluator);
139

    
140
             /**
141
         * Sets the {@link FeatureAttributeEmulator} that is used to update the 
142
         * presentation of a field.
143
         * @param featureAttributeEmulator
144
         *             the {@link FeatureAttributeEmulator} to set.
145
     * @return 
146
         */
147
        public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator);
148

    
149
        public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression);
150

    
151
        public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(String expression);
152
        
153
        /**
154
         * Sets whether the related FeatureAttribute is read only
155
         *
156
         * @param isReadOnly
157
         *
158
         * @return this
159
         */
160
        public EditableFeatureAttributeDescriptor setIsReadOnly(boolean isReadOnly);
161

    
162
        /**
163
         * Sets whether the related FeatureAttribute can have a null value
164
         *
165
         * @param allowNull
166
         *                                 a boolean value determining whether the FeatureAttribute can be null
167
         *
168
         * @return this
169
         */
170
        public EditableFeatureAttributeDescriptor setAllowNull(boolean allowNull);
171

    
172
        /**
173
         * Sets the SRS.
174
         *
175
         * @param SRS
176
         *
177
         * @return
178
         */
179
        public EditableFeatureAttributeDescriptor setSRS(IProjection SRS);
180

    
181
        public EditableFeatureAttributeDescriptor setSRS(String SRS);
182
        
183
        public EditableFeatureAttributeDescriptor setInterval(Interval interval);
184
        
185
            /**
186
     * Sets the geometry type
187
     * 
188
     * @param geometryType
189
     * 
190
     * @return this
191
     * @deprecated use {@link #setGeometryType(GeometryType)} instead
192
     */
193
    public EditableFeatureAttributeDescriptor setGeometryType(int geometryType);
194

    
195
            /**
196
     * Sets the geometry subtype
197
     * 
198
     * @param geometrySubType
199
     * 
200
     * @return this
201
     * @deprecated use {@link #setGeometryType(GeometryType)} instead
202
     */
203
        public EditableFeatureAttributeDescriptor setGeometrySubType(
204
                        int geometrySubType);
205

    
206
    /**
207
     * Sets the geometry type
208
     * 
209
     * @param geometryType
210
     * 
211
     * @return this
212
     */
213
    public EditableFeatureAttributeDescriptor setGeometryType(
214
        GeometryType geometryType);
215
    
216
    /**
217
     * Sets the geometry type and subtype. The format is:
218
     * <code>{geometryType}{sep}[geometrySubtype}</code> where:
219
     * <ul>
220
     * <li>geometryType is the name of the type of geometry.</li>
221
     * <li>sep is a character from ":/-!;#@".</li>
222
     * <li>geometrySubtype is the name of the subtype of geometry.</li>
223
     * </ul>
224
     * 
225
     * @param geometryType
226
     * @return 
227
     */
228
    public EditableFeatureAttributeDescriptor setGeometryType(String geometryType);
229

    
230
    public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType);
231

    
232
    /**
233
     * Sets the default value
234
     * 
235
     * @param defaultValue
236
     * 
237
     * @return this
238
     */
239
        public EditableFeatureAttributeDescriptor setDefaultValue(
240
                        Object defaultValue);
241
 
242
        /**
243
         * Sets additional information of the attribute
244
         * @return TODO
245
         *
246
         *
247
         */
248
        public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value);
249

    
250
        /**
251
         * Sets whether the related FeatureAttribute is part of the FeatureType's
252
         * primary key
253
         *
254
         * @param isPrimaryKey
255
         *            true if is part of the primary key
256
         * @return this
257
         */
258
        public EditableFeatureAttributeDescriptor setIsAutomatic(
259
                        boolean isAutomatic);
260

    
261
        /**
262
         * Sets is the attribute is a temporal attribute.
263
     *
264
          * @param isTime
265
          *        <code>true</code> if the attribute is temporal
266
         * @return
267
         *         this
268
         */
269
        public EditableFeatureAttributeDescriptor setIsTime(boolean isTime);
270
        
271
        /**
272
         * Sets if this attribute is indexed in the table.
273
         * @param isIndexed
274
         * @return  this
275
         */
276
        public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed);
277
        
278
        public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds);
279
        
280
        public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending);
281
        
282
        /**
283
         * Returns the attribute descriptor's name before
284
         * it was changed or null if never changed 
285
         * @return
286
         */
287
        public String getOriginalName();
288
    
289
       /**
290
         * If this attribute is of type Date, then this method set
291
         * the date format set by the data store.
292
         *
293
         * @return
294
         */
295
        public EditableFeatureAttributeDescriptor  setDateFormat(DateFormat dateFormat);
296
    
297
}