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

History | View | Annotate | Download (8.17 KB)

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