Revision 43420 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 | ||
---|---|---|
26 | 26 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
27 | 27 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
28 | 28 |
import org.gvsig.fmap.dal.feature.FeatureType; |
29 |
import org.gvsig.fmap.dal.feature.exception.SetReadOnlyAttributeException;
|
|
29 |
import org.gvsig.fmap.geom.DataTypes;
|
|
30 | 30 |
import org.gvsig.fmap.geom.Geometry; |
31 | 31 |
import org.gvsig.fmap.geom.primitive.Envelope; |
32 |
import org.gvsig.tools.ToolsLocator; |
|
33 |
import org.gvsig.tools.dataTypes.CoercionException; |
|
32 | 34 |
|
33 | 35 |
/** |
34 | 36 |
* Default implementation for {@link FeatureProvider} |
... | ... | |
77 | 79 |
* java.lang.Object) |
78 | 80 |
*/ |
79 | 81 |
public void set(int i, Object value) { |
80 |
FeatureAttributeDescriptor attribute = featureType.getAttributeDescriptor(i);
|
|
81 |
if( this.isReadOnly(i) ) {
|
|
82 |
FeatureAttributeDescriptor attribute = featureType.getAttributeDescriptor(i); |
|
83 |
if( this.isReadOnly(i) ) { |
|
82 | 84 |
return; |
83 | 85 |
} |
84 | 86 |
if (featureType.getDefaultGeometryAttributeIndex() == i) { |
85 |
defaultGeometry = (Geometry) value; |
|
86 |
envelope = null; |
|
87 |
if( value instanceof Geometry ) { |
|
88 |
defaultGeometry = (Geometry) value; |
|
89 |
} else { |
|
90 |
try { |
|
91 |
defaultGeometry = (Geometry) ToolsLocator.getDataTypesManager().coerce(DataTypes.GEOMETRY, value); |
|
92 |
} catch (CoercionException ex) { |
|
93 |
|
|
94 |
} |
|
95 |
} |
|
96 |
envelope = null; |
|
87 | 97 |
} |
88 | 98 |
if (value == null) { |
89 | 99 |
nulls[i] = true; |
Also available in: Unified diff