Revision 45102
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 | ||
---|---|---|
30 | 30 |
import java.time.temporal.TemporalAccessor; |
31 | 31 |
import java.util.Date; |
32 | 32 |
import java.util.Set; |
33 |
import java.util.function.Predicate; |
|
33 | 34 |
import javax.json.JsonNumber; |
34 | 35 |
import javax.json.JsonObject; |
35 | 36 |
import org.gvsig.fmap.dal.DataTypes; |
... | ... | |
301 | 302 |
|
302 | 303 |
@Override |
303 | 304 |
public void copyFrom(JsonObject values) { |
304 |
// iterate over the attributes and copy one by one |
|
305 |
this.copyFrom(values, null); |
|
306 |
} |
|
307 |
|
|
308 |
@Override |
|
309 |
public void copyFrom(JsonObject values, Predicate<FeatureAttributeDescriptor> filter) { |
|
310 |
// iterate over the attributes and copy one by one |
|
305 | 311 |
for (FeatureAttributeDescriptor attr : this.getType()) { |
312 |
if( filter!=null && !filter.test(attr) ) { |
|
313 |
continue; |
|
314 |
} |
|
306 | 315 |
if (attr==null || attr.isAutomatic() || attr.isReadOnly() || attr.isComputed() ) { |
307 | 316 |
continue; |
308 | 317 |
} |
... | ... | |
403 | 412 |
|
404 | 413 |
@Override |
405 | 414 |
public void copyFrom(Feature source) { |
415 |
this.copyFrom(source, null); |
|
416 |
} |
|
417 |
|
|
418 |
@Override |
|
419 |
public void copyFrom(Feature source, Predicate<FeatureAttributeDescriptor> filter) { |
|
406 | 420 |
// iterate over the attributes and copy one by one |
407 | 421 |
FeatureType sourceType = source.getType(); |
408 | 422 |
for (FeatureAttributeDescriptor attr : this.getType()) { |
423 |
if( filter!=null && !filter.test(attr) ) { |
|
424 |
continue; |
|
425 |
} |
|
409 | 426 |
if (attr==null || attr.isAutomatic() || attr.isReadOnly() || attr.isComputed() ) { |
410 | 427 |
continue; |
411 | 428 |
} |
... | ... | |
423 | 440 |
LOG.trace("The exception thrown is: ", th); |
424 | 441 |
} |
425 | 442 |
} |
443 |
|
|
426 | 444 |
} |
445 |
|
|
427 | 446 |
|
447 |
|
|
428 | 448 |
@Override |
429 | 449 |
public void setInstant(String name, Instant value) { |
430 | 450 |
FeatureAttributeDescriptor attribute = this.getType().getAttributeDescriptor(name); |
Also available in: Unified diff