Class MemoizeExtension.Generator.MethodOverrider
- java.lang.Object
-
- com.google.auto.value.extension.memoized.processor.MemoizeExtension.Generator.MethodOverrider
-
- Enclosing class:
- MemoizeExtension.Generator
private final class MemoizeExtension.Generator.MethodOverrider extends java.lang.Object
Determines the required fields and overriding method for a@Memoized
method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
MemoizeExtension.Generator.MethodOverrider.CheckBooleanField
private class
MemoizeExtension.Generator.MethodOverrider.InitializationStrategy
private class
MemoizeExtension.Generator.MethodOverrider.NullMeansUninitialized
-
Field Summary
Fields Modifier and Type Field Description private com.squareup.javapoet.FieldSpec
cacheField
private com.google.common.collect.ImmutableList.Builder<com.squareup.javapoet.FieldSpec>
fields
private javax.lang.model.element.ExecutableElement
method
private com.squareup.javapoet.MethodSpec.Builder
override
-
Constructor Summary
Constructors Constructor Description MethodOverrider(javax.lang.model.element.ExecutableElement method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private com.squareup.javapoet.FieldSpec
buildCacheField(com.squareup.javapoet.TypeName type, java.lang.String name)
Builds aFieldSpec
for use in property caching.private void
checkIllegalModifier(javax.lang.model.element.Modifier modifier)
(package private) java.lang.Iterable<com.squareup.javapoet.FieldSpec>
fields()
The fields that should be added to the subclass.(package private) com.squareup.javapoet.MethodSpec
method()
The overriding method that should be added to the subclass.private javax.lang.model.element.ExecutableElement
objectMethod(java.lang.String methodName)
private boolean
overridesObjectMethod(java.lang.String methodName)
private void
printMessage(javax.tools.Diagnostic.Kind kind, java.lang.String format, java.lang.Object... args)
private boolean
pullDownMethodAnnotation(javax.lang.model.element.AnnotationMirror annotation)
(package private) MemoizeExtension.Generator.MethodOverrider.InitializationStrategy
strategy()
private void
validate()
-
-
-
Field Detail
-
method
private final javax.lang.model.element.ExecutableElement method
-
override
private final com.squareup.javapoet.MethodSpec.Builder override
-
cacheField
private final com.squareup.javapoet.FieldSpec cacheField
-
fields
private final com.google.common.collect.ImmutableList.Builder<com.squareup.javapoet.FieldSpec> fields
-
-
Method Detail
-
fields
java.lang.Iterable<com.squareup.javapoet.FieldSpec> fields()
The fields that should be added to the subclass.
-
method
com.squareup.javapoet.MethodSpec method()
The overriding method that should be added to the subclass.
-
validate
private void validate()
-
checkIllegalModifier
private void checkIllegalModifier(javax.lang.model.element.Modifier modifier)
-
printMessage
private void printMessage(javax.tools.Diagnostic.Kind kind, java.lang.String format, java.lang.Object... args)
-
overridesObjectMethod
private boolean overridesObjectMethod(java.lang.String methodName)
-
objectMethod
private javax.lang.model.element.ExecutableElement objectMethod(java.lang.String methodName)
-
pullDownMethodAnnotation
private boolean pullDownMethodAnnotation(javax.lang.model.element.AnnotationMirror annotation)
-
buildCacheField
private com.squareup.javapoet.FieldSpec buildCacheField(com.squareup.javapoet.TypeName type, java.lang.String name)
Builds aFieldSpec
for use in property caching. Field will beprivate volatile
and have the given type and name. If the @LazyInit annotation is available it is added as well.
-
strategy
MemoizeExtension.Generator.MethodOverrider.InitializationStrategy strategy()
-
-