Package com.google.auto.common
Class SuperficialValidation
java.lang.Object
com.google.auto.common.SuperficialValidation
A utility class that traverses
Element instances and ensures that all type information
is present and resolvable.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ElementVisitor<Boolean, Void> private static final TypeVisitor<Boolean, Void> private static final AnnotationValueVisitor<Boolean, TypeMirror> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanprivate static booleanvalidateAnnotation(AnnotationMirror annotationMirror) private static booleanvalidateAnnotations(Iterable<? extends AnnotationMirror> annotationMirrors) private static booleanvalidateAnnotationValue(AnnotationValue annotationValue, TypeMirror expectedType) private static booleanvalidateAnnotationValues(Map<? extends ExecutableElement, ? extends AnnotationValue> valueMap) static booleanvalidateElement(Element element) Returns true if all types referenced by the given element are defined.static booleanvalidateElements(Iterable<? extends Element> elements) Returns true if all of the given elements return true fromvalidateElement(Element).static booleanvalidateType(TypeMirror type) Returns true if the given type is fully defined.private static booleanvalidateTypes(Iterable<? extends TypeMirror> types)
-
Field Details
-
ELEMENT_VALIDATING_VISITOR
-
TYPE_VALIDATING_VISITOR
-
VALUE_VALIDATING_VISITOR
-
-
Constructor Details
-
SuperficialValidation
private SuperficialValidation()
-
-
Method Details
-
validateElements
Returns true if all of the given elements return true fromvalidateElement(Element). -
validateElement
Returns true if all types referenced by the given element are defined. The exact meaning of this depends on the kind of element. For packages, it means that all annotations on the package are fully defined. For other element kinds, it means that types referenced by the element, anything it contains, and any of its annotations element are all defined. -
isValidBaseElement
-
validateTypes
-
validateType
Returns true if the given type is fully defined. This means that the type itself is defined, as are any types it references, such as any type arguments or type bounds. For anExecutableType, the parameter and return types must be fully defined, as must types declared in athrowsclause or in the bounds of any type parameters. -
validateAnnotations
-
validateAnnotation
-
validateAnnotationValues
private static boolean validateAnnotationValues(Map<? extends ExecutableElement, ? extends AnnotationValue> valueMap) -
validateAnnotationValue
private static boolean validateAnnotationValue(AnnotationValue annotationValue, TypeMirror expectedType)
-