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

pack-priv final Class MissingTypes

extends Object
Class Inheritance
Imports
java.util.List, javax.lang.model.element.ExecutableElement, javax.lang.model.element.VariableElement, javax.lang.model.type.ArrayType, javax.lang.model.type.DeclaredType, javax.lang.model.type.ErrorType, javax.lang.model.type.IntersectionType, javax.lang.model.type.TypeMirror, javax.lang.model.type.TypeVariable, javax.lang.model.type.WildcardType, javax.lang.model.util.SimpleTypeVisitor8

Handling of undefined types. When we see an undefined type, it might genuinely be undefined, or it might be a type whose source code will be generated later on as part of the same compilation. If we encounter an undefined type in a place where we need to know the type, we throw MissingTypeException. We then catch that and defer processing for the current class until the next annotation-processing "round". If the missing class has been generated in the meanwhile, we may now be able to complete processing. After a round has completed without generating any new source code, if there are still missing types then we report an error.
Author
[email protected] (Éamonn McManus)

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
MissingTypes.MissingTypeException

Exception thrown in the specific case where processing of a class was abandoned because it required types that the class references to be present and they were not.

private static class

Field Summary

Modifier and TypeField and Description
private static final MissingTypes.MissingTypeVisitor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
deferIfMissingTypesIn(javax.lang.model.element.ExecutableElement method)

Check that the return type and parameter types of the given method are all defined, and arrange to defer processing until the next round if not.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MISSING_TYPE_VISITORback to summary
private static final MissingTypes.MissingTypeVisitor MISSING_TYPE_VISITOR

Constructor Detail

MissingTypesback to summary
private MissingTypes()

Method Detail

deferIfMissingTypesInback to summary
pack-priv static void deferIfMissingTypesIn(javax.lang.model.element.ExecutableElement method)

Check that the return type and parameter types of the given method are all defined, and arrange to defer processing until the next round if not.

Exceptions
MissingTypeException:
if the return type or a parameter type of the given method is undefined
com.google.auto.value.processor back to summary

pack-priv Class MissingTypes.MissingTypeException

extends RuntimeException
Class Inheritance
Annotations
@SuppressWarnings:serial

Exception thrown in the specific case where processing of a class was abandoned because it required types that the class references to be present and they were not. This case is handled specially because it is possible that those types might be generated later during annotation processing, so we should reattempt the processing of the class in a later annotation processing round.

Constructor Summary

AccessConstructor and Description
pack-priv
MissingTypeException(javax.lang.model.type.ErrorType missingType)

Constructor Detail

MissingTypeExceptionback to summary
pack-priv MissingTypeException(javax.lang.model.type.ErrorType missingType)
com.google.auto.value.processor back to summary

private Class MissingTypes.MissingTypeVisitor

extends javax.lang.model.util.SimpleTypeVisitor8
Class Inheritance
  • java.lang.Object
  • ⋱
  • javax.lang.model.util.SimpleTypeVisitor8
  • com.google.auto.value.processor.MissingTypes.MissingTypeVisitor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
check(javax.lang.model.type.TypeMirror type)

private Void
visitAll(List<? extends javax.lang.model.type.TypeMirror> types, TypeMirrorSet visiting)

public Void
visitArray(javax.lang.model.type.ArrayType t, TypeMirrorSet visiting)

public Void
visitDeclared(javax.lang.model.type.DeclaredType t, TypeMirrorSet visiting)

public Void
visitError(javax.lang.model.type.ErrorType t, TypeMirrorSet visiting)

public Void
visitIntersection(javax.lang.model.type.IntersectionType t, TypeMirrorSet visiting)

public Void
visitTypeVariable(javax.lang.model.type.TypeVariable t, TypeMirrorSet visiting)

public Void
visitWildcard(javax.lang.model.type.WildcardType t, TypeMirrorSet visiting)

Constructor Detail

MissingTypeVisitorback to summary
private MissingTypeVisitor()

Method Detail

checkback to summary
pack-priv void check(javax.lang.model.type.TypeMirror type)
visitAllback to summary
private Void visitAll(List<? extends javax.lang.model.type.TypeMirror> types, TypeMirrorSet visiting)
visitArrayback to summary
public Void visitArray(javax.lang.model.type.ArrayType t, TypeMirrorSet visiting)
Annotations
@Override
visitDeclaredback to summary
public Void visitDeclared(javax.lang.model.type.DeclaredType t, TypeMirrorSet visiting)
Annotations
@Override
visitErrorback to summary
public Void visitError(javax.lang.model.type.ErrorType t, TypeMirrorSet visiting)
Annotations
@Override
visitIntersectionback to summary
public Void visitIntersection(javax.lang.model.type.IntersectionType t, TypeMirrorSet visiting)
Annotations
@Override
visitTypeVariableback to summary
public Void visitTypeVariable(javax.lang.model.type.TypeVariable t, TypeMirrorSet visiting)
Annotations
@Override
visitWildcardback to summary
public Void visitWildcard(javax.lang.model.type.WildcardType t, TypeMirrorSet visiting)
Annotations
@Override