Class LombokSupport
java.lang.Object
org.checkerframework.checker.calledmethods.builder.LombokSupport
- All Implemented Interfaces:
- BuilderFrameworkSupport
Lombok support for the Called Methods Checker. This class adds CalledMethods annotations to the
 code generated by Lombok.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe list of annotations that Lombok treats as non-null.
- 
Constructor SummaryConstructorsConstructorDescriptionLombokSupport(CalledMethodsAnnotatedTypeFactory atypeFactory) Create a new LombokSupport.
- 
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) Returns true if a method is abuildmethod on aBuildertype for the builder framework.booleanisToBuilderMethod(ExecutableElement candidateToBuilderElement) Returns true if a method is atoBuildermethod on a type generated by the builder framework.
- 
Field Details- 
NONNULL_ANNOTATIONSThe list of annotations that Lombok treats as non-null.
 
- 
- 
Constructor Details- 
LombokSupportCreate a new LombokSupport.- Parameters:
- atypeFactory- the typechecker's type factory
 
 
- 
- 
Method Details- 
isBuilderBuildMethodDescription copied from interface:BuilderFrameworkSupportReturns true if a method is abuildmethod on aBuildertype for the builder framework.- Specified by:
- isBuilderBuildMethodin interface- BuilderFrameworkSupport
- Parameters:
- candidateBuildElement- a method
- Returns:
- trueif- candidateBuildElementis a- buildmethod on a- Buildertype for the builder framework
 
- 
handleBuilderBuildMethodDescription copied from interface:BuilderFrameworkSupportHook 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.- Specified by:
- handleBuilderBuildMethodin interface- BuilderFrameworkSupport
- Parameters:
- builderBuildType- the type of a method that is the- buildmethod (as determined by- BuilderFrameworkSupport.isBuilderBuildMethod(ExecutableElement)) for a builder
 
- 
isToBuilderMethodDescription copied from interface:BuilderFrameworkSupportReturns true if a method is atoBuildermethod on a type generated by the builder framework.- Specified by:
- isToBuilderMethodin interface- BuilderFrameworkSupport
- Parameters:
- candidateToBuilderElement- a method
- Returns:
- trueif- candidateToBuilderElementis a- toBuildermethod on a type generated by the builder framework
 
- 
handleToBuilderMethodDescription copied from interface:BuilderFrameworkSupportHook 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.- Specified by:
- handleToBuilderMethodin interface- BuilderFrameworkSupport
- Parameters:
- toBuilderType- the type of a method that is the- toBuildermethod (as determined by- BuilderFrameworkSupport.isToBuilderMethod(ExecutableElement)) for a type that has an associated builder
 
- 
handleConstructorDescription copied from interface:BuilderFrameworkSupportHook for adding annotations (e.g.,@CalledMethods) to a constructor call.- Specified by:
- handleConstructorin interface- BuilderFrameworkSupport
- Parameters:
- tree- a constructor call
- type- type of the call expression
 
 
-