public class IGJChecker extends BaseTypeChecker
ReadOnly
, Mutable
,
Immutable
, I
-- a polymorphic qualifier, Assignable
,
and AssignsFields
. The language is specified by the FSE 2007 paper.SourceChecker.CheckerError
Modifier and Type | Field and Description |
---|---|
protected @Nullable AnnotationMirror |
ASSIGNS_FIELDS
Supported annotations for IGJ.
|
protected @Nullable AnnotationMirror |
BOTTOM_QUAL
Supported annotations for IGJ.
|
protected @Nullable AnnotationMirror |
I
Supported annotations for IGJ.
|
protected @Nullable AnnotationMirror |
IMMUTABLE
Supported annotations for IGJ.
|
protected @Nullable AnnotationMirror |
MUTABLE
Supported annotations for IGJ.
|
protected @Nullable AnnotationMirror |
READONLY
Supported annotations for IGJ.
|
currentPath, currentRoot, env, messager, messages, trees
processingEnv
Constructor and Description |
---|
IGJChecker() |
Modifier and Type | Method and Description |
---|---|
protected @Nullable QualifierHierarchy |
createQualifierHierarchy()
Returns the type qualifier hierarchy graph to be used by this processor.
|
protected TypeHierarchy |
createTypeHierarchy()
Creates the type subtyping checker using the current type qualifier
hierarchy.
|
void |
initChecker(ProcessingEnvironment env)
Initialize the checker.
|
boolean |
isAssignable(@Mutable AnnotatedTypeMirror varType,
@Mutable AnnotatedTypeMirror receiverType,
@Nullable Tree varTree,
AnnotatedTypeFactory factory)
Return true if the assignment variable is an assignable field or
variable, and returns false otherwise.
|
createFactory, createQualifierHierarchyFactory, createSourceVisitor, createSupportedTypeQualifiers, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, invokeConstructorFor, isSubtype
errorAbort, errorAbort, formatStackTrace, fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, init, message, report, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, typeProcess
process, typeProcessingOver
getCompletions, isInitialized, toString
protected @Nullable AnnotationMirror READONLY
protected @Nullable AnnotationMirror MUTABLE
protected @Nullable AnnotationMirror IMMUTABLE
protected @Nullable AnnotationMirror I
protected @Nullable AnnotationMirror ASSIGNS_FIELDS
protected @Nullable AnnotationMirror BOTTOM_QUAL
public void initChecker(ProcessingEnvironment env)
SourceChecker
initChecker
in class BaseTypeChecker
AbstractProcessor.init(ProcessingEnvironment)
public boolean isAssignable(@Mutable AnnotatedTypeMirror varType, @Mutable AnnotatedTypeMirror receiverType, @Nullable Tree varTree, AnnotatedTypeFactory factory)
Assignable
3. accessed through a mutable reference
4. reassigned with an AssignsFields
method and owned by 'this'isAssignable
in class BaseTypeChecker
varType
- the annotated variable typevarTree
- tree used to access the variableprotected @Nullable QualifierHierarchy createQualifierHierarchy()
BaseTypeChecker
BaseTypeChecker.getSupportedTypeQualifiers()
using the
meta-annotations found in them. The current implementation returns an
instance of GraphQualifierHierarchy
.
Subclasses may override this method to express any relationships that
cannot be inferred using meta-annotations (e.g. due to lack of
meta-annotations).createQualifierHierarchy
in class BaseTypeChecker
protected TypeHierarchy createTypeHierarchy()
BaseTypeChecker
createTypeHierarchy
in class BaseTypeChecker