*/
public class MuleAnnotationParser implements ExpressionAnnotationParser
{
public ExpressionArgument parse(Annotation annotation, Class parameterType)
{
Evaluator evaluator = annotation.annotationType().getAnnotation(Evaluator.class);
if (evaluator != null)
{
Mule muleAnnotation = (Mule)annotation;
String val = muleAnnotation.value();
if ("message.payload".equals(val))
{
//Match the param type and attempt to auto convert
val += "(" + parameterType.getName() + ")";
}
return new ExpressionArgument(null, new ExpressionConfig(val, evaluator.value(), null),
muleAnnotation.optional(), parameterType);
}
else
{
throw new IllegalArgumentException("The @Evaluator annotation must be set on an Expression Annotation");