Class BlockTemplate

java.lang.Object
com.google.errorprone.refaster.Template<com.google.errorprone.refaster.BlockTemplateMatch>
com.google.errorprone.refaster.BlockTemplate
All Implemented Interfaces:
Serializable

public abstract class BlockTemplate extends Template<com.google.errorprone.refaster.BlockTemplateMatch>
Template representing a sequence of consecutive statements.
Author:
lowasser@google.com (Louis Wasserman)
See Also:
  • Constructor Details

    • BlockTemplate

      public BlockTemplate()
  • Method Details

    • create

      public static BlockTemplate create(UStatement... templateStatements)
    • create

      public static BlockTemplate create(Map<String,? extends UType> expressionArgumentTypes, UStatement... templateStatements)
    • create

      public static BlockTemplate create(Iterable<UTypeVar> typeVariables, Map<String,? extends UType> expressionArgumentTypes, UStatement... templateStatements)
    • create

      public static BlockTemplate create(com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations, Iterable<UTypeVar> typeVariables, Map<String,? extends UType> expressionArgumentTypes, Iterable<? extends UStatement> templateStatements)
    • withStatements

      public BlockTemplate withStatements(Iterable<? extends UStatement> templateStatements)
    • match

      public Iterable<com.google.errorprone.refaster.BlockTemplateMatch> match(com.sun.tools.javac.tree.JCTree tree, com.sun.tools.javac.util.Context context)
      If the tree is a JCTree.JCBlock, returns a list of disjoint matches corresponding to the exact list of template statements found consecutively; otherwise, returns an empty list.
      Specified by:
      match in class Template<com.google.errorprone.refaster.BlockTemplateMatch>
    • replace

      public Fix replace(com.google.errorprone.refaster.BlockTemplateMatch match)
      Specified by:
      replace in class Template<com.google.errorprone.refaster.BlockTemplateMatch>