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