Revision 47779 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 | ||
---|---|---|
39 | 39 |
import java.util.Set; |
40 | 40 |
import java.util.function.Predicate; |
41 | 41 |
import javax.json.JsonObject; |
42 |
import org.apache.commons.collections4.CollectionUtils; |
|
42 | 43 |
import org.apache.commons.lang3.ArrayUtils; |
43 | 44 |
import org.apache.commons.lang3.StringUtils; |
44 | 45 |
import org.cresques.cts.IProjection; |
... | ... | |
216 | 217 |
} |
217 | 218 |
|
218 | 219 |
if (value == null) { |
219 |
if (!attribute.allowNull()) { |
|
220 |
if (!attribute.isAutomatic()) { |
|
221 |
throw new IllegalValueException(attribute, value); |
|
220 |
if (this.isInserted()) { |
|
221 |
if (!attribute.allowNull()) { |
|
222 |
if (!attribute.isAutomatic()) { |
|
223 |
throw new IllegalValueException(attribute, value); |
|
224 |
} |
|
222 | 225 |
} |
223 | 226 |
} |
224 | 227 |
this.data.set(i, null); |
... | ... | |
1686 | 1689 |
|
1687 | 1690 |
Bitmask mode = Bitmask.createBitmask((int) props.getOrDefault(TOJSON_MODE,TOJSON_MODE_SHALLOW)); |
1688 | 1691 |
boolean skipNulls = (boolean) props.getOrDefault("skipnulls", false); |
1689 |
String skipField = (String) props.getOrDefault("skipfield", null);
|
|
1692 |
String[] skipFields = (String[]) props.getOrDefault("skipfields", null);
|
|
1690 | 1693 |
Map<String,Object>properties = new HashMap<>(); |
1691 | 1694 |
|
1692 | 1695 |
for (FeatureAttributeDescriptor desc : ft) { |
... | ... | |
1695 | 1698 |
continue; |
1696 | 1699 |
} |
1697 | 1700 |
} |
1698 |
if(!StringUtils.isBlank(skipField) && StringUtils.equals(skipField, desc.getName())){
|
|
1701 |
if(ArrayUtils.contains(skipFields, desc.getName())) {
|
|
1699 | 1702 |
continue; |
1700 | 1703 |
} |
1704 |
|
|
1705 |
if(desc.getType() == DataTypes.GEOMETRY){ |
|
1706 |
continue; |
|
1707 |
} |
|
1708 |
|
|
1701 | 1709 |
if( this.isNull(desc.getName()) ){ |
1702 | 1710 |
if(!skipNulls){ |
1703 | 1711 |
properties.put(desc.getName(),null); |
Also available in: Unified diff