Revision 44376 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/feature/spi/DefaultFeatureProvider.java
DefaultFeatureProvider.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.fmap.dal.feature.spi; |
24 | 24 |
|
25 |
import org.apache.commons.lang3.StringUtils; |
|
25 | 26 |
import org.gvsig.fmap.dal.DataTypes; |
26 | 27 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
27 | 28 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
45 | 46 |
protected Envelope envelope; |
46 | 47 |
private Object oid; |
47 | 48 |
private boolean isNew = false; |
49 |
|
|
50 |
private String[] extraValuesNames; |
|
51 |
private Object[] extraValues; |
|
48 | 52 |
|
49 | 53 |
public DefaultFeatureProvider(FeatureType type) { |
50 | 54 |
if (type instanceof EditableFeatureType) { |
... | ... | |
278 | 282 |
public void setNew(boolean isNew) { |
279 | 283 |
this.isNew = isNew; |
280 | 284 |
} |
285 |
|
|
286 |
@Override |
|
287 |
public void setExtraValue(int index, Object value) { |
|
288 |
this.extraValues[index] = value; |
|
289 |
} |
|
290 |
|
|
291 |
@Override |
|
292 |
public Object getExtraValue(int index) { |
|
293 |
if( this.extraValues == null ) { |
|
294 |
return null; |
|
295 |
} |
|
296 |
return this.extraValues[index]; |
|
297 |
} |
|
298 |
|
|
299 |
@Override |
|
300 |
public Object getExtraValue(String name) { |
|
301 |
if( this.extraValuesNames == null || this.extraValues == null) { |
|
302 |
return null; |
|
303 |
} |
|
304 |
for (int i = 0; i < this.extraValuesNames.length; i++) { |
|
305 |
if( StringUtils.equalsIgnoreCase(this.extraValuesNames[i], name) ) { |
|
306 |
return this.extraValues[i]; |
|
307 |
} |
|
308 |
} |
|
309 |
return null; |
|
310 |
} |
|
311 |
|
|
312 |
@Override |
|
313 |
public void setExtraValueNames(String[] extraValueNames) { |
|
314 |
this.extraValuesNames = extraValueNames; |
|
315 |
this.extraValues = new Object[this.extraValuesNames.length]; |
|
316 |
} |
|
317 |
|
|
318 |
|
|
281 | 319 |
} |
Also available in: Unified diff