private void validateValue(TransactionElement element, Property property, Class<?> binding) { Object value = property.getValue(); // was it a null? If so, assume valid (already checked for nulls before) if (value == null // parsed as null || (value instanceof String && ((String) value).trim().isEmpty()) // as an empty string || (value instanceof Map && ((Map) value).isEmpty()) // or the usual map that the parser creates ) { return; } // see if the datastore machinery will be able to convert Object converted = Converters.convert(value, binding); if (converted == null) { String propertyName = property.getName().getLocalPart(); WFSException e = new WFSException( element, "Invalid value for property " + propertyName, WFSException.INVALID_VALUE); e.setLocator(propertyName); throw e; } }
public static PropertyType unadapt(Property property) { PropertyType p = WfsFactory.eINSTANCE.createPropertyType(); p.setName(property.getName()); p.setValue(property.getValue()); return p; } }
private SimpleFeature prepareInsertFeature( SimpleFeature feature, Update update, Date referenceTime) { SimpleFeatureBuilder builder = new SimpleFeatureBuilder(feature.getFeatureType()); builder.init(feature); SimpleFeature versionedFeature = builder.buildFeature(null); // run the update for (Object o : update.getUpdateProperties()) { Property p = (Property) o; versionedFeature.setAttribute(p.getName().getLocalPart(), p.getValue()); } // set the time setTimeAttribute(versionedFeature, referenceTime); return versionedFeature; }
if (property.getValue() == null) { String propertyName = property.getName().getLocalPart(); AttributeDescriptor attributeType = null;
names[j] = cleanupXPath(propertyName.getLocalPart()); types[j] = store.getSchema().getDescriptor(names[j]); values[j] = property.getValue();