}
FilterFactory ff = CommonFactoryFinder.getFilterFactory( null );
// check that all required properties have a specified value
UpdateElementType update = (UpdateElementType) element;
try {
FeatureTypeInfo meta = (FeatureTypeInfo) typeInfos.values().iterator().next();
FeatureType featureType = meta.getFeatureType();
for (Iterator prop = update.getProperty().iterator(); prop.hasNext();) {
PropertyType property = (PropertyType) prop.next();
//check that valus that are non-nillable exist
if (property.getValue() == null) {
String propertyName = property.getName().getLocalPart();
AttributeDescriptor attributeType = null;
PropertyDescriptor pd = featureType.getDescriptor(propertyName);
if(pd instanceof AttributeDescriptor) {
attributeType = (AttributeDescriptor) pd;
}
if ((attributeType != null) && (attributeType.getMinOccurs() > 0)) {
String msg = "Property '" + attributeType.getLocalName()
+ "' is mandatory but no value specified.";
throw new WFSException(msg, "MissingParameterValue");
}
}
//check that property names are actually valid
QName name = property.getName();
PropertyName propertyName = null;
if ( name.getPrefix() != null && !"".equals( name.getPrefix() )) {
propertyName = ff.property( name.getPrefix() + ":" + name.getLocalPart() );
}
else {
propertyName = ff.property( name.getLocalPart() );
}
if ( propertyName.evaluate( featureType ) == null ) {
String msg = "No such property: " + property.getName();
throw new WFSException( msg );
}
}
} catch (IOException e) {
throw new WFSTransactionException("Could not locate feature type information for "
+ update.getTypeName(), e, update.getHandle());
}
}