Top Inners Fields Constructors Methods
com.google.auto.value.processor

pack-priv Class Nullables

extends Object
Class Inheritance
Static Imports
java.util.stream.Collectors.toList

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final String
pack-priv static final String
NULLABLE_OPTION

If set to a non-empty string, defines which @Nullable type annotation should be used by default.

private final Optional<javax.lang.model.element.AnnotationMirror>

Constructor Summary

AccessConstructor and Description
private
Nullables(Optional<javax.lang.model.element.AnnotationMirror> nullableTypeAnnotation)

Method Summary

Modifier and TypeMethod and Description
private static javax.lang.model.element.AnnotationMirror
annotationMirrorOf(javax.lang.model.type.DeclaredType annotationType)

private static Optional<javax.lang.model.element.AnnotationMirror>
defaultNullableTypeAnnotation(javax.annotation.processing.ProcessingEnvironment processingEnv)

pack-priv static Nullables
fromMethods(javax.annotation.processing.ProcessingEnvironment
the ProcessingEnvironment, or null if one is unavailable (typically in tests)
processingEnv
,
Collection<javax.lang.model.element.ExecutableElement>
the methods to examine
methods
)

Make an instance where the default @Nullable type annotation is discovered by looking for methods whose parameter or return types have such an annotation.

private static Optional<javax.lang.model.element.AnnotationMirror>
nullableIn(javax.lang.model.type.TypeMirror type)

private static Optional<javax.lang.model.element.AnnotationMirror>
nullableIn(List<? extends javax.lang.model.element.AnnotationMirror> annotations)

pack-priv ImmutableList<javax.lang.model.element.AnnotationMirror>
nullableTypeAnnotations()

Returns a list that is either empty or contains a single element that is an appropriate @Nullable type-annotation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_NULLABLEback to summary
private static final String DEFAULT_NULLABLE
NULLABLE_OPTIONback to summary
pack-priv static final String NULLABLE_OPTION

If set to a non-empty string, defines which @Nullable type annotation should be used by default. If set to an empty string, does not insert @Nullable unless it is referenced in the @AutoValue methods. If unset, defaults to DEFAULT_NULLABLE.

nullableTypeAnnotationback to summary
private final Optional<javax.lang.model.element.AnnotationMirror> nullableTypeAnnotation

Constructor Detail

Nullablesback to summary
private Nullables(Optional<javax.lang.model.element.AnnotationMirror> nullableTypeAnnotation)

Method Detail

annotationMirrorOfback to summary
private static javax.lang.model.element.AnnotationMirror annotationMirrorOf(javax.lang.model.type.DeclaredType annotationType)
defaultNullableTypeAnnotationback to summary
private static Optional<javax.lang.model.element.AnnotationMirror> defaultNullableTypeAnnotation(javax.annotation.processing.ProcessingEnvironment processingEnv)
fromMethodsback to summary
pack-priv static Nullables fromMethods(javax.annotation.processing.ProcessingEnvironment processingEnv, Collection<javax.lang.model.element.ExecutableElement> methods)

Make an instance where the default @Nullable type annotation is discovered by looking for methods whose parameter or return types have such an annotation. If there are none, use a default @Nullable type annotation if it is available.

Parameters
processingEnv:javax.annotation.processing.ProcessingEnvironment

the ProcessingEnvironment, or null if one is unavailable (typically in tests)

methods:Collection<javax.lang.model.element.ExecutableElement>

the methods to examine

nullableInback to summary
private static Optional<javax.lang.model.element.AnnotationMirror> nullableIn(javax.lang.model.type.TypeMirror type)
nullableInback to summary
private static Optional<javax.lang.model.element.AnnotationMirror> nullableIn(List<? extends javax.lang.model.element.AnnotationMirror> annotations)
nullableTypeAnnotationsback to summary
pack-priv ImmutableList<javax.lang.model.element.AnnotationMirror> nullableTypeAnnotations()

Returns a list that is either empty or contains a single element that is an appropriate @Nullable type-annotation.

com.google.auto.value.processor back to summary

private Class Nullables.NullableFinder

extends javax.lang.model.util.SimpleTypeVisitor8,java.lang.Void>
Class Inheritance
  • java.lang.Object
  • ⋱
  • javax.lang.model.util.SimpleTypeVisitor8,java.lang.Void>
  • com.google.auto.value.processor.Nullables.NullableFinder

Field Summary

Modifier and TypeField and Description
private final TypeMirrorSet

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private Optional<javax.lang.model.element.AnnotationMirror>
visitAll(List<? extends javax.lang.model.type.TypeMirror> types)

public Optional<javax.lang.model.element.AnnotationMirror>
visitArray(javax.lang.model.type.ArrayType t, Void unused)

public Optional<javax.lang.model.element.AnnotationMirror>
visitDeclared(javax.lang.model.type.DeclaredType t, Void unused)

public Optional<javax.lang.model.element.AnnotationMirror>
visitIntersection(javax.lang.model.type.IntersectionType t, Void unused)

public Optional<javax.lang.model.element.AnnotationMirror>
visitTypeVariable(javax.lang.model.type.TypeVariable t, Void unused)

public Optional<javax.lang.model.element.AnnotationMirror>
visitWildcard(javax.lang.model.type.WildcardType t, Void unused)

Field Detail

visitingback to summary
private final TypeMirrorSet visiting

Constructor Detail

NullableFinderback to summary
pack-priv NullableFinder()

Method Detail

visitAllback to summary
private Optional<javax.lang.model.element.AnnotationMirror> visitAll(List<? extends javax.lang.model.type.TypeMirror> types)
visitArrayback to summary
public Optional<javax.lang.model.element.AnnotationMirror> visitArray(javax.lang.model.type.ArrayType t, Void unused)
Annotations
@Override
visitDeclaredback to summary
public Optional<javax.lang.model.element.AnnotationMirror> visitDeclared(javax.lang.model.type.DeclaredType t, Void unused)
Annotations
@Override
visitIntersectionback to summary
public Optional<javax.lang.model.element.AnnotationMirror> visitIntersection(javax.lang.model.type.IntersectionType t, Void unused)
Annotations
@Override
visitTypeVariableback to summary
public Optional<javax.lang.model.element.AnnotationMirror> visitTypeVariable(javax.lang.model.type.TypeVariable t, Void unused)
Annotations
@Override
visitWildcardback to summary
public Optional<javax.lang.model.element.AnnotationMirror> visitWildcard(javax.lang.model.type.WildcardType t, Void unused)
Annotations
@Override