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 a PatternBuilder. Main documentation at http://spoon.gforge.inria.fr/pattern.html.
  • Constructor Details

    • PatternBuilderHelper

      public PatternBuilderHelper(CtType<?> templateTemplate)
  • Method Details

    • setTypeMember

      public PatternBuilderHelper setTypeMember(String typeMemberName)
      Sets a template model from CtTypeMember of a template type
      Parameters:
      typeMemberName - the name of the CtTypeMember 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 of CtMethod
    • 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 of CtMethod
    • 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
    • getPatternElements

      public List<CtElement> getPatternElements()
      Returns:
      a List of CtElements, which has to be used as pattern model