|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.source.util.TreeScanner<R,P>
com.sun.source.util.TreePathScanner<R,P>
checkers.source.SourceVisitor<R,P>
checkers.basetype.BaseTypeVisitor<Void,Void>
checkers.javari.JavariVisitor
public class JavariVisitor
A type-checking visitor for the Javari mutability annotations
(@ReadOnly, @Mutable and @Assignable) that
extends BaseTypeVisitor.
BaseTypeVisitor| Field Summary |
|---|
| Fields inherited from class checkers.basetype.BaseTypeVisitor |
|---|
annoFactory, annoTypes, checker, visitorState |
| Fields inherited from class checkers.source.SourceVisitor |
|---|
atypeFactory, elements, root, trees, types |
| Constructor Summary | |
|---|---|
JavariVisitor(JavariChecker checker,
CompilationUnitTree root)
Creates a new visitor for type-checking the Javari mutability annotations. |
|
| Method Summary | |
|---|---|
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. |
void |
validateTypeOf(Tree tree)
Tests whether the tree expressed by the passed type tree contains a qualified primitive type on its qualified type, and if so emits an error. |
Void |
visitClass(ClassTree node,
Void p)
Ensures the class type is not @PolyRead outside a
@PolyRead context. |
Void |
visitTypeCast(TypeCastTree node,
Void p)
Emits a warning if a cast is made increasing mutability. |
| Methods inherited from class com.sun.source.util.TreePathScanner |
|---|
getCurrentPath, scan |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavariVisitor(JavariChecker checker,
CompilationUnitTree root)
checker - the JavariChecker to useroot - the root of the input program's AST to check| Method Detail |
|---|
public Void visitClass(ClassTree node,
Void p)
@PolyRead outside a
@PolyRead context.
visitClass in interface TreeVisitor<Void,Void>visitClass in class BaseTypeVisitor<Void,Void>
protected void checkAssignability(AnnotatedTypeMirror varType,
Tree varTree)
checkAssignability in class BaseTypeVisitor<Void,Void>varType - the type of the variable being re-assignedvarTree - the tree used to access the variable in the assignmentpublic void validateTypeOf(Tree tree)
validateTypeOf in class BaseTypeVisitor<Void,Void>tree - the AST type supplied by the user
public Void visitTypeCast(TypeCastTree node,
Void p)
visitTypeCast in interface TreeVisitor<Void,Void>visitTypeCast in class BaseTypeVisitor<Void,Void>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||