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

History | View | Annotate | Download (8.62 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.dataTypes.DataType;
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 
46
        extends FeatureAttributeDescriptor 
47
    {
48

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

    
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);
65

    
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);
73

    
74
        public EditableFeatureAttributeDescriptor setDataType(DataType dataType);
75

    
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);
86

    
87
        /**
88
         * Sets the precision
89
         *
90
         * @param
91
         *                 precision of type int
92
         *
93
         * @return this
94
         */
95
        public EditableFeatureAttributeDescriptor setPrecision(int precision);
96

    
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);
107

    
108
        /**
109
         * Sets the number of minimum occurrences
110
         *
111
         * @param minimumOccurrences
112
         *
113
         * @return this
114
         */
115
        public EditableFeatureAttributeDescriptor setMinimumOccurrences(
116
                        int minimumOccurrences);
117

    
118
        /**
119
         * Sets the maximum number of occurrences
120
         *
121
         * @param maximumOccurrences
122
         *
123
         * @return
124
         */
125
        public EditableFeatureAttributeDescriptor setMaximumOccurrences(
126
                        int maximumOccurrences);
127

    
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);
137

    
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);
145

    
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);
154

    
155
        public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression);
156

    
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);
167

    
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);
177

    
178
        /**
179
         * Sets the SRS.
180
         *
181
         * @param SRS
182
         *
183
         * @return
184
         */
185
        public EditableFeatureAttributeDescriptor setSRS(IProjection SRS);
186

    
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);
200

    
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);
211

    
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);
235

    
236
    public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType);
237

    
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);
255

    
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);
264

    
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);
301

    
302
        public EditableFeatureAttributeDescriptor set(String name, Object value);
303
}