Revision 45769 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/DefaultEditableFeature.java
DefaultEditableFeature.java | ||
---|---|---|
328 | 328 |
public void copyFrom(JsonObject values, Predicate<FeatureAttributeDescriptor> filter) { |
329 | 329 |
// iterate over the attributes and copy one by one |
330 | 330 |
for (FeatureAttributeDescriptor attr : this.getType()) { |
331 |
if (attr==null ) { |
|
332 |
continue; |
|
333 |
} |
|
331 | 334 |
if( filter!=null && !filter.test(attr) ) { |
332 | 335 |
continue; |
333 | 336 |
} |
334 |
if (attr==null || attr.isAutomatic() || attr.isReadOnly() || attr.isComputed() ) {
|
|
337 |
if (attr.isAutomatic() || attr.isComputed() ) {
|
|
335 | 338 |
continue; |
336 | 339 |
} |
340 |
if( this.isInserted() && attr.isReadOnly()) { |
|
341 |
continue; |
|
342 |
} |
|
337 | 343 |
String attrname = attr.getName(); |
338 | 344 |
if( !values.containsKey(attrname) ) { |
339 | 345 |
continue; |
... | ... | |
458 | 464 |
// iterate over the attributes and copy one by one |
459 | 465 |
FeatureType sourceType = source.getType(); |
460 | 466 |
for (FeatureAttributeDescriptor attr : this.getType()) { |
467 |
if (attr==null ) { |
|
468 |
continue; |
|
469 |
} |
|
461 | 470 |
if( filter!=null && !filter.test(attr) ) { |
462 | 471 |
continue; |
463 | 472 |
} |
464 |
if (attr==null || attr.isAutomatic() || attr.isReadOnly() || attr.isComputed() ) {
|
|
473 |
if (attr.isAutomatic() || attr.isComputed() ) {
|
|
465 | 474 |
continue; |
466 | 475 |
} |
476 |
if( this.isInserted() && attr.isReadOnly()) { |
|
477 |
continue; |
|
478 |
} |
|
467 | 479 |
String attrname = attr.getName(); |
468 | 480 |
if( sourceType.getAttributeDescriptor(attrname)==null ) { |
469 | 481 |
continue; |
Also available in: Unified diff