1 package org.apache.commons.digester3.annotations.handlers;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.lang.reflect.Method;
23
24 import org.apache.commons.digester3.annotations.AnnotationHandler;
25 import org.apache.commons.digester3.annotations.rules.CallMethod;
26 import org.apache.commons.digester3.binder.CallMethodBuilder;
27 import org.apache.commons.digester3.binder.RulesBinder;
28
29
30
31
32
33
34 public class CallMethodHandler
35 implements AnnotationHandler<CallMethod, Method>
36 {
37
38
39
40
41 public void handle( CallMethod annotation, Method element, RulesBinder rulesBinder )
42 {
43 CallMethodBuilder callMethodBuilder = rulesBinder
44 .forPattern( annotation.pattern() )
45 .withNamespaceURI( annotation.namespaceURI() )
46 .callMethod( element.getName() )
47 .withParamTypes( element.getParameterTypes() );
48
49 if ( annotation.usingElementBodyAsArgument() )
50 {
51 callMethodBuilder.usingElementBodyAsArgument();
52 }
53 }
54
55 }