checkers.oigj
Class ImmutabilitySubchecker

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by com.sun.source.util.AbstractTypeProcessor
          extended by checkers.source.SourceChecker
              extended by checkers.basetype.BaseTypeChecker
                  extended by checkers.oigj.ImmutabilitySubchecker
All Implemented Interfaces:
Processor

@TypeQualifiers(value={ReadOnly.class,Mutable.class,Immutable.class,I.class,AssignsFields.class,checkers.oigj.OIGJMutabilityBottom.class})
public class ImmutabilitySubchecker
extends BaseTypeChecker


Field Summary
Modifier and Type Field and Description
protected  AnnotationMirror ASSIGNS_FIELDS
          Supported annotations for IGJ.
protected  AnnotationMirror BOTTOM_QUAL
          Supported annotations for IGJ.
protected  AnnotationMirror I
          Supported annotations for IGJ.
protected  AnnotationMirror IMMUTABLE
          Supported annotations for IGJ.
protected  AnnotationMirror MUTABLE
          Supported annotations for IGJ.
protected  AnnotationMirror READONLY
          Supported annotations for IGJ.
 
Fields inherited from class checkers.source.SourceChecker
currentPath, currentRoot, env, messager, messages, trees
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
Constructor and Description
ImmutabilitySubchecker()
           
 
Method Summary
Modifier and Type Method and Description
protected  TypeHierarchy createTypeHierarchy()
          Creates the type subtyping checker using the current type qualifier hierarchy.
 void init(ProcessingEnvironment env)
          
 boolean isAssignable(AnnotatedTypeMirror varType, AnnotatedTypeMirror receiverType, Tree varTree)
          Tests whether the variable accessed is an assignable variable or not, given the current scope
 
Methods inherited from class checkers.basetype.BaseTypeChecker
createFactory, createQualifierHierarchy, createSourceVisitor, createSupportedTypeQualifiers, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, isSubtype, isValidUse
 
Methods inherited from class checkers.source.SourceChecker
getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, message, report, typeProcess
 
Methods inherited from class com.sun.source.util.AbstractTypeProcessor
process, typeProcessingOver
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READONLY

protected AnnotationMirror READONLY
Supported annotations for IGJ. Used for subtyping rules.


MUTABLE

protected AnnotationMirror MUTABLE
Supported annotations for IGJ. Used for subtyping rules.


IMMUTABLE

protected AnnotationMirror IMMUTABLE
Supported annotations for IGJ. Used for subtyping rules.


I

protected AnnotationMirror I
Supported annotations for IGJ. Used for subtyping rules.


ASSIGNS_FIELDS

protected AnnotationMirror ASSIGNS_FIELDS
Supported annotations for IGJ. Used for subtyping rules.


BOTTOM_QUAL

protected AnnotationMirror BOTTOM_QUAL
Supported annotations for IGJ. Used for subtyping rules.

Constructor Detail

ImmutabilitySubchecker

public ImmutabilitySubchecker()
Method Detail

init

public void init(ProcessingEnvironment env)
Description copied from class: SourceChecker

Specified by:
init in interface Processor
Overrides:
init in class BaseTypeChecker
See Also:
AbstractProcessor.init(ProcessingEnvironment)

createTypeHierarchy

protected TypeHierarchy createTypeHierarchy()
Description copied from class: BaseTypeChecker
Creates the type subtyping checker using the current type qualifier hierarchy. Subclasses may override this method to specify new type checking rules beyond the typical java subtyping rules.

Overrides:
createTypeHierarchy in class BaseTypeChecker
Returns:
the type relations class to check type subtyping

isAssignable

public boolean isAssignable(AnnotatedTypeMirror varType,
                            AnnotatedTypeMirror receiverType,
                            Tree varTree)
Description copied from class: BaseTypeChecker
Tests whether the variable accessed is an assignable variable or not, given the current scope

Overrides:
isAssignable in class BaseTypeChecker
Parameters:
varType - the annotated variable type
varTree - tree used to access the variable
Returns:
true iff variable is assignable in the current scope