Package spoon.pattern
Class PatternBuilderHelper
java.lang.Object
spoon.pattern.PatternBuilderHelper
Utility class to select parts of AST to be used as a model of a
PatternBuilder
.
Main documentation at http://spoon.gforge.inria.fr/pattern.html.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionkeepTypeMembers(Filter<? super CtElement> filter)
removes super class from the templatesetBodyOfMethod(String methodName)
Sets a template model from body of the method of template typesetReturnExpressionOfMethod(String methodName)
Sets a template model from return expression of the method of template type selected by filtersetTypeMember(String typeMemberName)
Sets a template model fromCtTypeMember
of a template type
-
Constructor Details
-
PatternBuilderHelper
-
-
Method Details
-
setTypeMember
Sets a template model fromCtTypeMember
of a template type- Parameters:
typeMemberName
- the name of theCtTypeMember
of a template type
-
setBodyOfMethod
Sets a template model from body of the method of template type- Parameters:
methodName
- the name ofCtMethod
-
setReturnExpressionOfMethod
Sets a template model from return expression of the method of template type selected by filter- Parameters:
methodName
- the name ofCtMethod
-
keepTypeMembers
- Parameters:
filter
- whose matches will be kept in the template. All others will be removed
-
removeSuperClass
removes super class from the template -
getPatternElements
- Returns:
- a List of
CtElement
s, which has to be used as pattern model
-