Revision 45258 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/DefaultFeatureAttributeDescriptor.java
DefaultFeatureAttributeDescriptor.java | ||
---|---|---|
40 | 40 |
import javax.json.JsonObject; |
41 | 41 |
import javax.json.JsonObjectBuilder; |
42 | 42 |
import org.apache.commons.lang3.ArrayUtils; |
43 |
import org.apache.commons.lang3.ObjectUtils; |
|
43 | 44 |
import org.apache.commons.lang3.StringUtils; |
44 | 45 |
import org.apache.commons.lang3.tuple.Pair; |
45 | 46 |
import org.cresques.cts.IProjection; |
... | ... | |
679 | 680 |
scale = state.getInt("scale"); |
680 | 681 |
roundMode = state.getInt("roundMode"); |
681 | 682 |
String locale_s = state.getString("locale"); |
682 |
locale = StringUtils.isBlank(locale_s) ? null : Locale.forLanguageTag(locale_s); |
|
683 |
locale = StringUtils.isBlank(locale_s) ? null : Locale.forLanguageTag(locale_s); // || "null".equalsIgnoreCase(locale_s)
|
|
683 | 684 |
evaluator = (Evaluator) state.get("evaluator"); |
684 | 685 |
primaryKey = state.getBoolean("primaryKey"); |
685 | 686 |
readOnly = state.getBoolean("readOnly"); |
... | ... | |
762 | 763 |
state.set("objectClass", objectClass == null ? null : objectClass.getName()); |
763 | 764 |
state.set("precision", precision); |
764 | 765 |
state.set("scale", scale); |
765 |
state.set("roundMode", roundMode); |
|
766 |
try { |
|
767 |
if( this.locale == null ) { |
|
768 |
state.setNull("locale"); |
|
769 |
} else { |
|
770 |
state.set("locale", toString.coerce(this.locale)); |
|
771 |
} |
|
772 |
} catch (CoercionException ex) { |
|
766 |
state.set("roundMode", roundMode); |
|
767 |
if( this.locale == null ) { |
|
773 | 768 |
state.setNull("locale"); |
769 |
} else { |
|
770 |
state.set("locale", this.locale.toLanguageTag()); //toString.coerce(this.locale)); |
|
774 | 771 |
} |
775 | 772 |
state.set("evaluator", evaluator); |
776 | 773 |
|
... | ... | |
925 | 922 |
return this.avoidCachingAvailableValues; |
926 | 923 |
} |
927 | 924 |
|
925 |
public boolean hasAvailableValues() { |
|
926 |
return getAvailableValues()!=null; |
|
927 |
} |
|
928 |
|
|
928 | 929 |
@Override |
929 | 930 |
public DynObjectValueItem[] getAvailableValues() { |
930 | 931 |
DynObjectValueItem[] values = this.availableValues; |
... | ... | |
1672 | 1673 |
return this.displaySize; |
1673 | 1674 |
} |
1674 | 1675 |
|
1676 |
@Override |
|
1677 |
public boolean isInAvailableValues(Object valueToCheck) { |
|
1678 |
if (this.getAvailableValues()!=null) { |
|
1679 |
for (DynObjectValueItem availableValue : this.getAvailableValues()) { |
|
1680 |
if (Objects.equals(valueToCheck, availableValue.getValue())) { |
|
1681 |
return true; |
|
1682 |
} |
|
1683 |
} |
|
1684 |
} |
|
1685 |
return false; |
|
1686 |
} |
|
1687 |
|
|
1675 | 1688 |
private class ConstantValueEvaluator extends AbstractEvaluator { |
1676 | 1689 |
|
1677 | 1690 |
@Override |
Also available in: Unified diff