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
Constructors -
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 fromCtTypeMemberof a template type
-
Constructor Details
-
PatternBuilderHelper
-
-
Method Details
-
setTypeMember
Sets a template model fromCtTypeMemberof a template type- Parameters:
typeMemberName- the name of theCtTypeMemberof 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
CtElements, which has to be used as pattern model
-