public class JavariVisitor extends BaseTypeVisitor<JavariAnnotatedTypeFactory>
@ReadOnly
, @Mutable
and @Assignable
) that
extends BaseTypeVisitor.BaseTypeVisitor
atypeFactory, checker, contractsUtils, positions, typeValidator, visitorState
elements, root, trees, types
Constructor and Description |
---|
JavariVisitor(BaseTypeChecker checker)
Creates a new visitor for type-checking the Javari mutability
annotations.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAssignability(AnnotatedTypeMirror varType,
Tree varTree)
Checks whether the variable represented by the given type and
tree can be assigned, causing a checker error otherwise.
|
protected Set<? extends AnnotationMirror> |
getExceptionParameterLowerBoundAnnotations()
Returns a set of AnnotationMirrors that is a lower bound for exception
parameters.
|
boolean |
isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType elemType,
AnnotatedTypeMirror.AnnotatedDeclaredType useType,
Tree tree)
Always true; no type validity checking is made by the BaseTypeVisitor.
|
boolean |
isValidUse(AnnotatedTypeMirror.AnnotatedPrimitiveType useType,
Tree tree)
Tests that the qualifiers present on the primitive type are valid.
|
Void |
visitClass(ClassTree node,
Void p)
Ensures the class type is not
@PolyRead outside a
@PolyRead context. |
checkAccess, checkAccess, checkArguments, checkArrayInitialization, checkConditionalPostconditions, checkConditionalPostconditionsConsistency, checkConstructorInvocation, checkContract, checkDefaultConstructor, checkExceptionParameter, checkFlowExprParameters, checkForAnnotatedJdk, checkMethodInvocability, checkMethodReferenceAsOverride, checkOverride, checkPostconditions, checkPostconditionsConsistency, checkPreconditions, checkPreconditions, checkPreconditionsConsistency, checkThrownExpression, checkTypeArguments, checkTypecastRedundancy, checkTypecastSafety, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheck, createTypeFactory, createTypeValidator, enclosingMemberSelect, enclosingStatement, getThrowUpperBoundAnnotations, getTypeFactory, isAccessAllowed, isAssignable, isValidUse, isVectorCopyInto, reportPurityErrors, scan, setRoot, shouldSkipUses, skipContractCheck, skipReceiverSubtypeCheck, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotation, visitArrayAccess, visitAssignment, visitCatch, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitMethod, visitMethodInvocation, visitNewArray, visitNewClass, visitParameterizedType, visitReturn, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, visitVariable
visit
getCurrentPath, scan
reduce, scan, visitAnnotatedType, visitArrayType, visitAssert, visitBinary, visitBlock, visitBreak, visitCase, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitOther, visitParenthesized, visitPrimitiveType, visitSwitch, visitSynchronized, visitTry, visitUnionType, visitWhileLoop, visitWildcard
public JavariVisitor(BaseTypeChecker checker)
checker
- the JavariChecker
to usepublic Void visitClass(ClassTree node, Void p)
@PolyRead
outside a
@PolyRead
context.visitClass
in interface TreeVisitor<Void,Void>
visitClass
in class BaseTypeVisitor<JavariAnnotatedTypeFactory>
protected void checkAssignability(AnnotatedTypeMirror varType, Tree varTree)
checkAssignability
in class BaseTypeVisitor<JavariAnnotatedTypeFactory>
varType
- the type of the variable being re-assignedvarTree
- the tree used to access the variable in the assignmentprotected Set<? extends AnnotationMirror> getExceptionParameterLowerBoundAnnotations()
BaseTypeVisitor
getExceptionParameterLowerBoundAnnotations
in class BaseTypeVisitor<JavariAnnotatedTypeFactory>
public boolean isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType elemType, AnnotatedTypeMirror.AnnotatedDeclaredType useType, Tree tree)
isValidUse
in class BaseTypeVisitor<JavariAnnotatedTypeFactory>
elemType
- the type of the class (TypeElement)useType
- the use of the class (instance type)tree
- the tree where the type is usedBaseTypeVisitor
public boolean isValidUse(AnnotatedTypeMirror.AnnotatedPrimitiveType useType, Tree tree)
BaseTypeVisitor
isValidUse
in class BaseTypeVisitor<JavariAnnotatedTypeFactory>
useType
- the use of the primitive typetree
- the tree where the type is used