Package spoon.pattern
Class PatternBuilderHelper
- java.lang.Object
-
- spoon.pattern.PatternBuilderHelper
-
public class PatternBuilderHelper extends Object
Utility class to select parts of AST to be used as a model of aPatternBuilder
. Main documentation at http://spoon.gforge.inria.fr/pattern.html.
-
-
Constructor Summary
Constructors Constructor Description PatternBuilderHelper(CtType<?> templateTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CtElement>
getPatternElements()
PatternBuilderHelper
keepTypeMembers(Filter<? super CtElement> filter)
PatternBuilderHelper
removeSuperClass()
removes super class from the templatePatternBuilderHelper
setBodyOfMethod(String methodName)
Sets a template model from body of the method of template typePatternBuilderHelper
setReturnExpressionOfMethod(String methodName)
Sets a template model from return expression of the method of template type selected by filterPatternBuilderHelper
setTypeMember(String typeMemberName)
Sets a template model fromCtTypeMember
of a template type
-
-
-
Constructor Detail
-
PatternBuilderHelper
public PatternBuilderHelper(CtType<?> templateTemplate)
-
-
Method Detail
-
setTypeMember
public PatternBuilderHelper setTypeMember(String typeMemberName)
Sets a template model fromCtTypeMember
of a template type- Parameters:
typeMemberName
- the name of theCtTypeMember
of a template type
-
setBodyOfMethod
public PatternBuilderHelper setBodyOfMethod(String methodName)
Sets a template model from body of the method of template type- Parameters:
methodName
- the name ofCtMethod
-
setReturnExpressionOfMethod
public PatternBuilderHelper setReturnExpressionOfMethod(String methodName)
Sets a template model from return expression of the method of template type selected by filter- Parameters:
methodName
- the name ofCtMethod
-
keepTypeMembers
public PatternBuilderHelper keepTypeMembers(Filter<? super CtElement> filter)
- Parameters:
filter
- whose matches will be kept in the template. All others will be removed
-
removeSuperClass
public PatternBuilderHelper removeSuperClass()
removes super class from the template
-
-