use of org.jowidgets.cap.service.api.annotation.Parameter in project jo-client-platform by jo-source.
the class ExecutorAnnotationPostProcessor method evaluateParameterExpression.
IMaybe<Object> evaluateParameterExpression(final Object parameter, final Method method, final int argIndex) {
final Annotation[] annotations = method.getParameterAnnotations()[argIndex];
for (final Annotation annotation : annotations) {
if (annotation instanceof Parameter) {
final Parameter paramAnno = (Parameter) annotation;
if (!expressions.containsKey(paramAnno)) {
expressions.putIfAbsent(paramAnno, expressionParser.parseExpression(paramAnno.value()));
}
final Expression expression = expressions.get(paramAnno);
return new Some<Object>(expression.getValue(parameter, method.getParameterTypes()[argIndex]));
}
}
return Nothing.getInstance();
}
Aggregations