Class AutoValueSupport
java.lang.Object
org.checkerframework.checker.calledmethods.builder.AutoValueSupport
- All Implemented Interfaces:
- BuilderFrameworkSupport
AutoValue support for the Called Methods Checker. This class adds 
@CalledMethods
 annotations to the code generated by AutoValue.- 
Constructor SummaryConstructorsConstructorDescriptionAutoValueSupport(CalledMethodsAnnotatedTypeFactory atypeFactory) Create a new AutoValueSupport.
- 
Method SummaryModifier and TypeMethodDescriptiongetAllAbstractMethods(TypeElement classElement) Get all the abstract methods for a class.voidhandleBuilderBuildMethod(AnnotatedTypeMirror.AnnotatedExecutableType builderBuildType) Hook for adding annotations to a build() method (i.e.voidhandleConstructor(NewClassTree tree, AnnotatedTypeMirror type) This method modifies the type of a copy constructor generated by AutoValue to match the type of the AutoValue toBuilder method, and has no effect iftreeis a call to any other constructor.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.
- 
Constructor Details- 
AutoValueSupportCreate a new AutoValueSupport.- Parameters:
- atypeFactory- the typechecker's type factory
 
 
- 
- 
Method Details- 
handleConstructorThis method modifies the type of a copy constructor generated by AutoValue to match the type of the AutoValue toBuilder method, and has no effect iftreeis a call to any other constructor.- Specified by:
- handleConstructorin interface- BuilderFrameworkSupport
- Parameters:
- tree- AST for a constructor call
- type- type of the call expression
 
- 
isBuilderBuildMethodDescription copied from interface:BuilderFrameworkSupportDetermines 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:BuilderFrameworkSupportDetermines 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
 
- 
getAllAbstractMethodsGet all the abstract methods for a class. This includes inherited abstract methods that are not overridden by the class or a superclass. There is no guarantee that this method will work as intended on code that implements an interface (which AutoValue classes are not supposed to do: https://github.com/google/auto/blob/master/value/userguide/howto.md#inherit).- Parameters:
- classElement- the class
- Returns:
- list of all abstract methods
 
 
-