KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > support > template > ParameterMatcher


1 package spoon.support.template;
2
3 import spoon.reflect.declaration.CtElement;
4 import spoon.reflect.reference.CtReference;
5 import spoon.template.TemplateMatcher;
6
7 /**
8  * Allows the definition of a specific matching policy for a given template
9  * parameter. When using {@link spoon.template.TemplateMatcher},
10  * parameters are by default matched to anything. Defining a new type and
11  * precising it in the {@link spoon.template.Parameter} annotation allows
12  * to precise the form that the parameter will match.
13  *
14  * <p>Note that this feature is not yet fully supported but will be in a close
15  * future.
16  */

17 public interface ParameterMatcher {
18
19      /**
20      * To be defined to implement a matching strategy for template parameter(s).
21      *
22      * @param templateMatcher the instance of the matcher that is currently
23      * performing the matching (up-caller)
24      * @param template the template element to match against
25      * @param toMatch the element to be tested for a match
26      * @return true if matching
27      */

28     boolean match(TemplateMatcher templateMatcher, CtElement template,
29             CtElement toMatch);
30    
31     /**
32      * To be defined to implement a matching strategy for template parameter(s).
33      *
34      * @param templateMatcher the instance of the matcher that is currently
35      * performing the matching (up-caller)
36      * @param template the template reference to match against
37      * @param toMatch the reference to be tested for a match
38      * @return true if matching
39      */

40     boolean match(TemplateMatcher templateMatcher, CtReference template,
41             CtReference toMatch);
42
43 }
44
Popular Tags