Class AutoOneOfProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
com.google.auto.value.processor.AutoValueOrOneOfProcessor
com.google.auto.value.processor.AutoOneOfProcessor
- All Implemented Interfaces:
Processor
@AutoService(Processor.class)
@SupportedAnnotationTypes("com.google.auto.value.AutoOneOf")
@SupportedOptions("com.google.auto.value.OmitIdentifiers")
public class AutoOneOfProcessor
extends AutoValueOrOneOfProcessor
Javac annotation processor (compiler plugin) for one-of types; user code never references this class.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AutoValueOrOneOfProcessor
AutoValueOrOneOfProcessor.ObjectMethod, AutoValueOrOneOfProcessor.Property -
Field Summary
Fields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddefineVarsForType(TypeElement type, AutoOneOfTemplateVars vars, com.google.common.collect.ImmutableSet<ExecutableElement> propertyMethods, ExecutableElement kindGetter) private ExecutableElementfindKindGetterOrAbort(TypeElement autoOneOfType, TypeMirror kindMirror, com.google.common.collect.ImmutableSet<ExecutableElement> abstractMethods) private DeclaredTypemirrorForKindType(TypeElement autoOneOfType) nullableAnnotationForMethod(ExecutableElement propertyMethod) Returns the appropriate@Nullableannotation to put on the implementation of the given property method, and indicates whether the property is in fact nullable.(package private) voidprocessType(TypeElement autoOneOfType) Analyzes a single@AutoValueor@AutoOneOfclass, and outputs the corresponding implementation class or classes.propertyToKindMap(DeclaredType kindMirror, com.google.common.collect.ImmutableSet<String> propertyNames) private static booleansameType(TypeMirror t1, TypeMirror t2) private Stringprivate voidvalidateMethods(TypeElement type, com.google.common.collect.ImmutableSet<ExecutableElement> abstractMethods, com.google.common.collect.ImmutableSet<ExecutableElement> propertyMethods, ExecutableElement kindGetter) Methods inherited from class AutoValueOrOneOfProcessor
abstractMethodsIn, annotationsToCopy, annotationStrings, checkModifiersIfNested, checkReturnType, defineSharedVarsForType, elementUtils, equalsParameterType, errorReporter, fixReservedIdentifiers, generatedClassName, getAnnotationMirror, getSerialVersionUID, getSupportedSourceVersion, hasAnnotationMirror, init, objectMethodToOverride, prefixedGettersIn, process, propertyMethodAnnotationMap, propertyMethodsIn, propertyNameToMethodMap, propertySet, typeUtils, writeSourceFileMethods inherited from class AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Constructor Details
-
AutoOneOfProcessor
public AutoOneOfProcessor()
-
-
Method Details
-
processType
Description copied from class:AutoValueOrOneOfProcessorAnalyzes a single@AutoValueor@AutoOneOfclass, and outputs the corresponding implementation class or classes.- Specified by:
processTypein classAutoValueOrOneOfProcessor- Parameters:
autoOneOfType- the class with the@AutoValueor@AutoOneOfannotation.
-
mirrorForKindType
-
propertyToKindMap
private com.google.common.collect.ImmutableMap<String,String> propertyToKindMap(DeclaredType kindMirror, com.google.common.collect.ImmutableSet<String> propertyNames) -
transformName
-
findKindGetterOrAbort
private ExecutableElement findKindGetterOrAbort(TypeElement autoOneOfType, TypeMirror kindMirror, com.google.common.collect.ImmutableSet<ExecutableElement> abstractMethods) -
validateMethods
private void validateMethods(TypeElement type, com.google.common.collect.ImmutableSet<ExecutableElement> abstractMethods, com.google.common.collect.ImmutableSet<ExecutableElement> propertyMethods, ExecutableElement kindGetter) -
defineVarsForType
private void defineVarsForType(TypeElement type, AutoOneOfTemplateVars vars, com.google.common.collect.ImmutableSet<ExecutableElement> propertyMethods, ExecutableElement kindGetter) -
nullableAnnotationForMethod
Description copied from class:AutoValueOrOneOfProcessorReturns the appropriate@Nullableannotation to put on the implementation of the given property method, and indicates whether the property is in fact nullable. The annotation in question is on the method, not its return type. If instead the return type is@Nullable, this method returnsOptional.of(""), to indicate that the property is nullable but the method isn't. The@Nullableannotation will instead appear when the return type of the method is spelled out in the implementation.- Specified by:
nullableAnnotationForMethodin classAutoValueOrOneOfProcessor
-
sameType
-