| java.lang.Object spoon.template.TemplateMatcher
TemplateMatcher | public class TemplateMatcher (Code) | | This class defines an engine for matching a template to pieces of code.
|
Method Summary | |
public boolean | find(CtElement targetRoot, CtElement templateRoot) Finds all target program sub-trees that correspond to a template. | public List<CtElement> | getFinds() Returns all the elements that correspond to a given template. | public Map<Object, Object> | getMatches() Returns all the matches in a map where the keys are the corresponding
template parameters. | public boolean | match(CtElement targetRoot, CtElement templateRoot) Matches a target program sub-tree against a template. |
TemplateMatcher | public TemplateMatcher(CtClass<? extends Template> templateType)(Code) | | Constructs a matcher for a given template.
Parameters: templateType - the type of the template |
find | public boolean find(CtElement targetRoot, CtElement templateRoot)(Code) | | Finds all target program sub-trees that correspond to a template. Once
this method has been called,
TemplateMatcher.getFinds() will give the mathing
CtElements if any.
Parameters: targetRoot - the target to be tested for match Parameters: templateRoot - the template to match against true if there is one or more matches See Also: TemplateMatcher.getFinds() |
|
|