}
}
} else {
if (argExpr instanceof TypeExpression
&& range.getName().equals(UIMAConstants.TYPE_STRING)) {
TypeExpression typeExpr = (TypeExpression) argExpr;
List<AnnotationFS> annotationsInWindow = stream.getAnnotationsInWindow(afs,
typeExpr.getType(getParent()));
if (annotationsInWindow != null && !annotationsInWindow.isEmpty()) {
AnnotationFS annotation = annotationsInWindow.get(0);
afs.setStringValue(feature, annotation.getCoveredText());
}
} else if (argExpr instanceof AbstractStringExpression
&& range.getName().equals(UIMAConstants.TYPE_STRING)) {
afs.setStringValue(feature,
((AbstractStringExpression) argExpr).getStringValue(getParent(), afs, stream));
// numbers are reserved for capturing groups
//
// } else if (argExpr instanceof NumberExpression) {
// if (range.getName().equals(UIMAConstants.TYPE_INTEGER)) {
// afs.setIntValue(feature,
// ((NumberExpression) argExpr).getIntegerValue(getParent()));
// } else if (range.getName().equals(UIMAConstants.TYPE_DOUBLE)) {
// afs.setDoubleValue(feature,
// ((NumberExpression) argExpr).getDoubleValue(getParent()));
// } else if (range.getName().equals(UIMAConstants.TYPE_FLOAT)) {
// afs.setFloatValue(feature,
// ((NumberExpression) argExpr).getFloatValue(getParent()));
// } else if (range.getName().equals(UIMAConstants.TYPE_BYTE)) {
// afs.setByteValue(feature,
// (byte) ((NumberExpression) argExpr).getIntegerValue(getParent()));
// } else if (range.getName().equals(UIMAConstants.TYPE_SHORT)) {
// afs.setShortValue(feature,
// (short) ((NumberExpression) argExpr).getIntegerValue(getParent()));
// } else if (range.getName().equals(UIMAConstants.TYPE_LONG)) {
// afs.setLongValue(feature,
// (long) ((NumberExpression) argExpr).getIntegerValue(getParent()));
// }
} else if (argExpr instanceof IBooleanExpression
&& range.getName().equals(UIMAConstants.TYPE_BOOLEAN)) {
afs.setBooleanValue(feature,
((IBooleanExpression) argExpr).getBooleanValue(getParent(), null, stream));
} else if (argExpr instanceof TypeExpression) {
TypeExpression typeExpr = (TypeExpression) argExpr;
List<AnnotationFS> annotationsInWindow = stream.getAnnotationsInWindow(afs,
typeExpr.getType(getParent()));
if (typeSystem.subsumes(jcas.getCasType(FSArray.type), range)) {
afs.setFeatureValue(feature, UIMAUtils.toFSArray(jcas, annotationsInWindow));
} else if (typeSystem.subsumes(range, typeExpr.getType(getParent()))
&& !annotationsInWindow.isEmpty()) {
AnnotationFS annotation = annotationsInWindow.get(0);
afs.setFeatureValue(feature, annotation);
}
}