public class InterningAnnotatedTypeFactory extends BaseAnnotatedTypeFactory
AnnotatedTypeFactory
that accounts for the properties of the
Interned type system. This type factory will add the Interned
annotation to a type if the input:
BaseAnnotatedTypeFactory
and inherits its
functionality, including: flow-sensitive qualifier inference, qualifier
polymorphism (of PolyInterned
), implicit annotations via
ImplicitFor
on Interned
(to handle cases 1, 2, 4), and
user-specified defaults via DefaultQualifier
.
Case 5 is handled by the stub library.GenericAnnotatedTypeFactory.ScanState
AnnotatedTypeFactory.InheritedFromClassAnnotator
analyses, defaults, FLOW_BY_DEFAULT, flowResult, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, treeAnnotator, typeAnnotator, useFlow
checker, elements, fromTreeCache, processingEnv, qualHierarchy, root, SHOULD_CACHE, SHOULD_READ_CACHE, shouldCache, shouldReadCache, trees, typeHierarchy, types, uid, visitorState
Constructor and Description |
---|
InterningAnnotatedTypeFactory(BaseTypeChecker checker)
Creates a new
InterningAnnotatedTypeFactory that operates on a
particular AST. |
Modifier and Type | Method and Description |
---|---|
void |
annotateImplicit(javax.lang.model.element.Element element,
AnnotatedTypeMirror type)
Adds implicit annotations to a type obtained from a
Element . |
protected TreeAnnotator |
createTreeAnnotator()
Returns a
TreeAnnotator that adds annotations to a type based
on the contents of a tree. |
protected TypeAnnotator |
createTypeAnnotator()
Returns a
TypeAnnotator that adds annotations to a type based
on the content of the type itself. |
AnnotatedTypeMirror.AnnotatedPrimitiveType |
getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
returns the annotated primitive type of the given declared type
if it is a boxed declared type.
|
createFlowAnalysis
analyze, annotateImplicit, annotateImplicit, annotateImplicitWithFlow, applyInferredAnnotations, constructorFromUse, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, dotOutputFileName, getDefaultedAnnotatedType, getEmptyStore, getFinalLocalValues, getInferredValueFor, getNodeForTree, getRegularExitStore, getReturnStatementStores, getStoreAfter, getStoreBefore, getSupportedMonotonicTypeQualifiers, getUseFlow, methodFromUse, performFlowAnalysis, postDirectSuperTypes, postInit, setRoot, setUseFlow
addAliasedAnnotation, addAliasedDeclAnnotation, aliasedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, buildIndexTypes, createLRUCache, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchyFactory, createSupportedTypeQualifiers, createTypeHierarchy, declarationFromElement, fromClass, fromElement, fromElement, fromElement, fromExpression, fromMember, fromNewClass, fromTypeTree, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFromTypeTree, getAnnotationMirror, getAnnotationWithMetaAnnotation, getBoxedType, getCurrentClassTree, getCurrentClassType, getCurrentMethodReceiver, getDeclAnnotation, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getElementUtils, getEnclosingMethod, getEnclosingType, getImplicitReceiverType, getMethodReturnType, getMethodReturnType, getPath, getProcessingEnv, getQualifierHierarchy, getReceiverType, getSelfType, getSupportedTypeQualifiers, getTreeUtils, getTypeHierarchy, getUninferredWildcardType, getVisitorState, getWildcardBoundedBy, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, postAsMemberOf, postProcessClassTree, setPathHack, toAnnotatedType, toString, type, typeVariablesFromUse
public InterningAnnotatedTypeFactory(BaseTypeChecker checker)
InterningAnnotatedTypeFactory
that operates on a
particular AST.checker
- the checker to useprotected TreeAnnotator createTreeAnnotator()
GenericAnnotatedTypeFactory
TreeAnnotator
that adds annotations to a type based
on the contents of a tree.
Subclasses may override this method to specify more appriopriate
TreeAnnotator
createTreeAnnotator
in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>
protected TypeAnnotator createTypeAnnotator()
GenericAnnotatedTypeFactory
TypeAnnotator
that adds annotations to a type based
on the content of the type itself.createTypeAnnotator
in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>
public void annotateImplicit(javax.lang.model.element.Element element, AnnotatedTypeMirror type)
AnnotatedTypeFactory
Element
. By
default, this method does nothing. Subclasses should use this method to
implement implicit annotations specific to their type systems.annotateImplicit
in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>
element
- an elementtype
- the type obtained from elt
public AnnotatedTypeMirror.AnnotatedPrimitiveType getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
AnnotatedTypeFactory
getUnboxedType
in class AnnotatedTypeFactory
type
- the declared type