Revision 25684
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java | ||
---|---|---|
68 | 68 |
throw new IllegalArgumentException(); |
69 | 69 |
} |
70 | 70 |
|
71 |
if (!attribute.allowNull() && value == null) { |
|
71 |
if (value == null) { |
|
72 |
if (!attribute.allowNull()) { |
|
72 | 73 |
throw new IllegalArgumentException(); |
73 |
} |
|
74 |
} |
|
75 |
this.data.set(i, null); |
|
76 |
return; |
|
74 | 77 |
|
78 |
} |
|
75 | 79 |
if (attribute.getObjectClass().isInstance(value)) { |
76 | 80 |
this.data.set(i, value); |
77 |
if (((DefaultFeatureType) this.data.getType()) |
|
78 |
.getDefaultGeometryAttributeIndex() == i) { |
|
79 |
this.data.setDefaultGeometry((Geometry) value); |
|
80 |
this.data.setDefaultEnvelope(((Geometry) value).getEnvelope()); |
|
81 |
} |
|
82 | 81 |
return; |
83 | 82 |
} |
84 |
if (value!=null && !(value instanceof String)) {
|
|
83 |
if (!(value instanceof String)) { |
|
85 | 84 |
throw new ClassCastException(); |
86 | 85 |
} |
87 |
if (value == null){ |
|
88 |
this.data.set(i, null); |
|
89 |
return; |
|
90 |
} |
|
91 | 86 |
int dataType = attribute.getDataType(); |
92 | 87 |
|
93 | 88 |
switch (dataType) { |
Also available in: Unified diff