public class InterningAnnotatedTypeFactory extends BasicAnnotatedTypeFactory<InterningChecker>
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:
BasicAnnotatedTypeFactory 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.AnnotatedTypeFactory.InheritedFromClassAnnotatorchecker, defaults, flow, FLOW_BY_DEFAULT, poly, treeAnnotator, typeAnnotator, useFlowannotations, atypes, elements, env, fromTreeCache, qualHierarchy, root, trees, types, uid, visitorState| Constructor and Description |
|---|
InterningAnnotatedTypeFactory(InterningChecker checker,
@Nullable CompilationUnitTree root)
Creates a new
InterningAnnotatedTypeFactory that operates on a
particular AST. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
annotateImplicit(@Nullable Element element,
@Mutable AnnotatedTypeMirror type)
Adds implicit annotations to a type obtained from a
Element. |
protected TreeAnnotator |
createTreeAnnotator(InterningChecker checker)
Returns a
TreeAnnotator that adds annotations to a type based
on the contents of a tree. |
protected TypeAnnotator |
createTypeAnnotator(InterningChecker checker)
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.
|
annotateImplicit, annotateImplicit, constructorFromUse, createFlow, createFlowQualifiers, getDefaultedAnnotatedType, methodFromUse, postDirectSuperTypes, postInitaddAliasedAnnotation, aliasedAnnotation, annotateInheritedFromClass, canHaveAnnotatedTypeParameters, createLRUCache, declarationFromElement, fromClass, fromElement, fromElement, fromElement, fromExpression, fromMember, fromNewClass, fromTypeTree, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFromTypeTree, getBoxedType, getCurrentClassTree, getCurrentClassType, getCurrentMethodReceiver, getDeclAnnotation, getEnclosingType, getImplicitReceiverType, getPath, getQualifierHierarchy, getReceiverType, getSelfType, getVisitorState, isAnyEnclosingThisDeref, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, postAsMemberOf, toAnnotatedType, toString, typeVariablesFromUse, unifypublic InterningAnnotatedTypeFactory(InterningChecker checker, @Nullable CompilationUnitTree root)
InterningAnnotatedTypeFactory that operates on a
particular AST.checker - the checker to useroot - the AST on which this type factory operatesprotected TreeAnnotator createTreeAnnotator(InterningChecker checker)
BasicAnnotatedTypeFactoryTreeAnnotator that adds annotations to a type based
on the contents of a tree.
Subclasses may override this method to specify more appriopriate
TreeAnnotatorcreateTreeAnnotator in class BasicAnnotatedTypeFactory<InterningChecker>protected TypeAnnotator createTypeAnnotator(InterningChecker checker)
BasicAnnotatedTypeFactoryTypeAnnotator that adds annotations to a type based
on the content of the type itself.createTypeAnnotator in class BasicAnnotatedTypeFactory<InterningChecker>protected void annotateImplicit(@Nullable Element element, @Mutable 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 BasicAnnotatedTypeFactory<InterningChecker>element - an elementtype - the type obtained from eltpublic AnnotatedTypeMirror.AnnotatedPrimitiveType getUnboxedType(AnnotatedTypeMirror.AnnotatedDeclaredType type)
AnnotatedTypeFactorygetUnboxedType in class AnnotatedTypeFactorytype - the declared type