Interface TypeValidator
- All Known Implementing Classes:
BaseTypeValidator,ReportVisitor.ReportTypeValidator
public interface TypeValidator
TypeValidator ensures that a type for a given tree is valid both for the tree and the type system
that is being used to check the tree.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid(AnnotatedTypeMirror type, Tree tree) The entry point to the type validator.voidvalidateTargetLocation(AnnotatedTypeMirror type, Tree tree, TypeUseLocation required) Validates whether the qualifiers on the tree are at the correct type-use locations, as specified by the meta-annotationTargetLocations.voidvalidateVariableTargetLocation(AnnotatedTypeMirror type, Tree tree) Validates whether the qualifiers on the variable tree are at the correct type-use locations, as specified by the meta-annotationTargetLocations.
-
Method Details
-
isValid
The entry point to the type validator. Validate the type against the given tree.- Parameters:
type- the type to validatetree- the tree from which the type originated. If the tree is a method tree, then validate its return type. If the tree is a variable tree, then validate its field type.- Returns:
- true, iff the type is valid
-
validateVariableTargetLocation
Validates whether the qualifiers on the variable tree are at the correct type-use locations, as specified by the meta-annotationTargetLocations.- Parameters:
type- the annotated type of the variabletree- the variable tree
-
validateTargetLocation
Validates whether the qualifiers on the tree are at the correct type-use locations, as specified by the meta-annotationTargetLocations.- Parameters:
type- the type of the treetree- the tree whose qualifiers are to be validatedrequired- the required TypeUseLocation
-