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