Revision 44448 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java
DefaultFeature.java | ||
---|---|---|
173 | 173 |
if ( objectClass.isInstance(value) ) { |
174 | 174 |
this.data.set(i, value); |
175 | 175 |
return; |
176 |
} |
|
177 |
|
|
178 |
if ( !objectClass.isInstance(value) ) { |
|
176 |
} else { |
|
177 |
DataProfile dataProfile = attribute.getDataProfile(); |
|
178 |
if( dataProfile!=null ) { |
|
179 |
try { |
|
180 |
value = dataProfile.coerce( |
|
181 |
attribute.getDataType(), |
|
182 |
value, |
|
183 |
attribute.getTags() |
|
184 |
); |
|
185 |
} catch (CoercionException e) { |
|
186 |
|
|
187 |
} |
|
188 |
} |
|
179 | 189 |
try { |
180 |
value |
|
181 |
= this.getDataTypesManager().coerce(attribute.getType(), |
|
182 |
value); |
|
190 |
value= this.getDataTypesManager().coerce(attribute.getType(),value); |
|
183 | 191 |
} catch (CoercionException e) { |
184 | 192 |
throw new IllegalArgumentException("Can't convert to " |
185 |
+ this.getDataTypesManager().getTypeName(
|
|
186 |
attribute.getType()) + " from '"
|
|
193 |
+ attribute.getDataType().getName()
|
|
194 |
+ " from '" |
|
187 | 195 |
+ value.getClass().getName() + "' with value '" |
188 | 196 |
+ value.toString() + "'."); |
189 | 197 |
} |
Also available in: Unified diff