1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.module.json.config; |
8 | |
|
9 | |
import org.mule.api.annotations.expression.JsonPath; |
10 | |
import org.mule.api.annotations.meta.Evaluator; |
11 | |
import org.mule.api.expression.ExpressionAnnotationParser; |
12 | |
import org.mule.expression.ExpressionConfig; |
13 | |
import org.mule.expression.transformers.ExpressionArgument; |
14 | |
|
15 | |
import java.lang.annotation.Annotation; |
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | 0 | public class JsonPathAnnotationParser implements ExpressionAnnotationParser |
21 | |
{ |
22 | |
public ExpressionArgument parse(Annotation annotation, Class<?> parameterType) |
23 | |
{ |
24 | 0 | Evaluator evaluator = annotation.annotationType().getAnnotation(Evaluator.class); |
25 | |
|
26 | 0 | return new ExpressionArgument(null, new ExpressionConfig(((JsonPath) annotation).value(), |
27 | |
evaluator.value(), null), ((JsonPath) annotation).optional(), parameterType); |
28 | |
} |
29 | |
|
30 | |
public boolean supports(Annotation annotation) |
31 | |
{ |
32 | 0 | return annotation instanceof JsonPath; |
33 | |
} |
34 | |
} |