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.ScanStateAnnotatedTypeFactory.InheritedFromClassAnnotatoranalyses, cfgVisualizer, defaults, FLOW_BY_DEFAULT, flowResult, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, treeAnnotator, typeAnnotatorchecker, elements, fromTreeCache, loader, processingEnv, qualHierarchy, reflectionResolver, root, shouldCache, trees, typeArgumentInference, typeFormatter, typeHierarchy, types, typeVarSubstitutor, 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(Element element,
AnnotatedTypeMirror type)
Adds implicit annotations to a type obtained from a
Element. |
void |
annotateImplicit(Tree tree,
AnnotatedTypeMirror type,
boolean useFlow)
Like {#annotateImplicit(Tree, AnnotatedTypeMirror)}.
|
protected TreeAnnotator |
createTreeAnnotator()
Returns a
TreeAnnotator that adds annotations to a type based
on the contents of a tree. |
protected TypeAnnotator |
createTypeAnnotator()
Returns a
ImplicitsTypeAnnotator
that adds annotations to a type based on the content of the type itself. |
AnnotatedTypeMirror.AnnotatedPrimitiveType |
getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
Unbox type and replace any interning type annotatiosn with @Interned since all
all primitives can safely use ==.
|
createFlowAnalysisaddCheckedCodeDefaults, addTypeNameImplicit, addUncheckedCodeDefaults, analyze, analyze, annotateImplicit, applyInferredAnnotations, checkAndPerformFlowAnalysis, constructorFromUse, createCFGVisualizer, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, getAnnotatedTypeLhs, getAnnotatedTypeLhsNoTypeVarDefault, getCFGVisualizer, getEmptyStore, getFinalLocalValues, getInferredValueFor, getNodeForTree, getRegularExitStore, getResultingTypeOfConstructorMemberReference, getReturnStatementStores, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, handleCFGViz, methodFromUse, performFlowAnalysis, postDirectSuperTypes, postInit, setRootadaptGetClassReturnTypeToReceiver, addAliasedAnnotation, addAliasedDeclAnnotation, addInheritedAnnotation, aliasedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, checkInvalidOptionsInferSignatures, createAnnotatedTypeFormatter, createAnnotationFormatter, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchyFactory, createSupportedTypeQualifiers, createTypeArgumentInference, createTypeHierarchy, createTypeVariableSubstitutor, declarationFromElement, fromElement, fromElement, fromElement, fromNewClass, getAnnotatedNullType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFromTypeTree, getAnnotationFormatter, getAnnotationMirror, getAnnotationWithMetaAnnotation, getBoxedType, getBundledTypeQualifiersWithoutPolyAll, getBundledTypeQualifiersWithPolyAll, getContext, getCurrentClassTree, getCurrentClassType, getCurrentMethodReceiver, getDeclAnnotation, getDeclAnnotationNoAliases, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getElementUtils, getEnclosingMethod, getEnclosingType, getFnInterfaceFromTree, getFnInterfaceFromTree, getImplicitReceiverType, getMethodReturnType, getMethodReturnType, getPath, getProcessingEnv, getQualifierHierarchy, getReceiverType, getSelfType, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeHierarchy, getTypeVarSubstitutor, getUninferredWildcardType, getVisitorState, getWholeProgramInference, initilizeReflectionResolution, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, methodFromUse, parseStubFiles, postAsMemberOf, postProcessClassTree, postTypeVarSubstitution, setPathHack, toAnnotatedType, toString, type, typeVariablesFromUse, widenToUpperBoundpublic InterningAnnotatedTypeFactory(BaseTypeChecker checker)
InterningAnnotatedTypeFactory that operates on a
particular AST.checker - the checker to useprotected TreeAnnotator createTreeAnnotator()
GenericAnnotatedTypeFactoryTreeAnnotator that adds annotations to a type based
on the contents of a tree.
Subclasses may override this method to specify a more appropriate
TreeAnnotator.createTreeAnnotator in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>protected TypeAnnotator createTypeAnnotator()
GenericAnnotatedTypeFactoryImplicitsTypeAnnotator
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(Tree tree, AnnotatedTypeMirror type, boolean useFlow)
GenericAnnotatedTypeFactoryannotateImplicit in class GenericAnnotatedTypeFactory<CFValue,CFStore,CFTransfer,CFAnalysis>public void annotateImplicit(Element element, AnnotatedTypeMirror type)
AnnotatedTypeFactoryElement. 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 eltpublic AnnotatedTypeMirror.AnnotatedPrimitiveType getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
getUnboxedType in class AnnotatedTypeFactorytype - the declared type