Interface BuilderFrameworkSupport
- All Known Implementing Classes:
- AutoValueSupport,- LombokSupport
public interface BuilderFrameworkSupport
Provides hooks to add CalledMethods annotations to code generated by a builder framework like
 Lombok or AutoValue. If you are adding support to the Called Methods Checker for a new builder
 framework, you should create a subclass of this class and modify the private method 
 enableFramework in CalledMethodsAnnotatedTypeFactory.
 Every method in this class is permitted to do nothing (or always return false). The work that each method must do is particular to the builder framework being supported.
- 
Method SummaryModifier and TypeMethodDescriptionvoidhandleBuilderBuildMethod(AnnotatedTypeMirror.AnnotatedExecutableType builderBuildType) Hook for adding annotations to a build() method (i.e.voidhandleConstructor(NewClassTree tree, AnnotatedTypeMirror type) Hook for adding annotations (e.g.,@CalledMethods) to a constructor call.voidhandleToBuilderMethod(AnnotatedTypeMirror.AnnotatedExecutableType toBuilderType) Hook for supporting a builder framework'stoBuilderroutine.booleanisBuilderBuildMethod(ExecutableElement candidateBuildElement) Determines if a method is abuildmethod on aBuildertype for the builder framework.booleanisToBuilderMethod(ExecutableElement candidateToBuilderElement) Determines if a method is atoBuildermethod on a type generated by the builder framework.
- 
Method Details- 
isToBuilderMethodDetermines if a method is atoBuildermethod on a type generated by the builder framework.- Parameters:
- candidateToBuilderElement- a method
- Returns:
- trueif- candidateToBuilderElementis a- toBuildermethod on a type generated by the builder framework
 
- 
handleToBuilderMethodHook for supporting a builder framework'stoBuilderroutine. Typically, the returned Builder has had all of its required setters invoked. So, implementations of this method should add aCalledMethodsannotation capturing this fact.- Parameters:
- toBuilderType- the type of a method that is the- toBuildermethod (as determined by- isToBuilderMethod(ExecutableElement)) for a type that has an associated builder
 
- 
isBuilderBuildMethodDetermines if a method is abuildmethod on aBuildertype for the builder framework.- Parameters:
- candidateBuildElement- a method
- Returns:
- trueif- candidateBuildElementis a- buildmethod on a- Buildertype for the builder framework
 
- 
handleBuilderBuildMethodHook for adding annotations to a build() method (i.e. a finalizer) generated by a builder framework.For buildmethods onBuildertypes, implementations of this method should determine the required properties and add a correspondingCalledMethodsannotation to the type of the receiver parameter.- Parameters:
- builderBuildType- the type of a method that is the- buildmethod (as determined by- isBuilderBuildMethod(ExecutableElement)) for a builder
 
- 
handleConstructorHook for adding annotations (e.g.,@CalledMethods) to a constructor call.- Parameters:
- tree- a constructor call
- type- type of the call expression
 
 
-