private Pair<QName, Integer> trySimpleMultiProp( ValueReference valueReference, FeatureType ft )
throws OWSException {
Expr expr = valueReference.getAsXPath();
if ( !( expr instanceof LocationPath ) ) {
throw new OWSException( "Cannot update property on feature type '" + ft.getName()
+ "'. Complex property paths are not supported.", OPERATION_NOT_SUPPORTED );
}
Object obj = ( (LocationPath) expr ).getSteps().get( 0 );
if ( !( obj instanceof NameStep ) ) {
throw new OWSException( "Cannot update property on feature type '" + ft.getName()
+ "'. Complex property paths are not supported.", OPERATION_NOT_SUPPORTED );
}
NameStep namestep = (NameStep) obj;
obj = namestep.getPredicates().get( 0 );
if ( !( obj instanceof Predicate ) ) {
throw new OWSException( "Cannot update property on feature type '" + ft.getName()
+ "'. Complex property paths are not supported.", OPERATION_NOT_SUPPORTED );
}
Predicate pred = (Predicate) obj;
expr = pred.getExpr();
if ( !( expr instanceof NumberExpr ) ) {
throw new OWSException( "Cannot update property on feature type '" + ft.getName()
+ "'. Complex property paths are not supported.", OPERATION_NOT_SUPPORTED );
}
NumberExpr ne = (NumberExpr) expr;
int index = Math.round( Float.parseFloat( ne.getText() ) );
String namespaceUri = determineNamespaceUri( valueReference, ft, namestep );
return new Pair<QName, Integer>( new QName( namespaceUri, namestep.getLocalName() ), index - 1 );
}