|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcheckers.types.AnnotatedTypeFactory
checkers.nullness.NullnessAnnotatedTypeFactory
public class NullnessAnnotatedTypeFactory extends AnnotatedTypeFactory
Adds the NonNull annotation to a type that is:
null literal)
DefaultQualifier annotation and
matches its location criteria
NonNull by flow-sensitive inference
Raw annotation to
Additionally, the type factory will add the Nullable annotation to a
type if the input is
Void,
NonNull fields as
Nullable depending on the presence of a Raw annotation on
a constructor or method receiver. Please review
the Checker Framework for Raw semantics.
| Modifier and Type | Class and Description |
|---|
| Nested classes/interfaces inherited from class checkers.types.AnnotatedTypeFactory |
|---|
AnnotatedTypeFactory.InheritedFromClassAnnotator |
| Modifier and Type | Field and Description |
|---|---|
protected AnnotationMirror |
LAZYNONNULL
Represents the Nullness Checker qualifiers |
protected AnnotationMirror |
NONNULL
Represents the Nullness Checker qualifiers |
protected AnnotationMirror |
NULLABLE
Represents the Nullness Checker qualifiers |
protected AnnotationMirror |
POLYNULL
Represents the Nullness Checker qualifiers |
protected AnnotationMirror |
RAW
Represents the Nullness Checker qualifiers |
| Fields inherited from class checkers.types.AnnotatedTypeFactory |
|---|
annotations, atypes, elements, env, qualHierarchy, root, trees, types, visitorState |
| Constructor and Description |
|---|
NullnessAnnotatedTypeFactory(NullnessSubchecker checker,
CompilationUnitTree root)
Creates a NullnessAnnotatedTypeFactory. |
| Modifier and Type | Method and Description |
|---|---|
protected AnnotationMirror |
aliasedAnnotation(AnnotationMirror a)
Aliased annotations. |
protected void |
annotateImplicit(Element elt,
AnnotatedTypeMirror type)
Adds implicit annotations to a type obtained from a Element. |
protected void |
annotateImplicit(Tree tree,
AnnotatedTypeMirror type)
Adds implicit annotations to a type obtained from a Tree. |
AnnotatedTypeMirror.AnnotatedExecutableType |
constructorFromUse(NewClassTree tree)
Determines the AnnotatedTypeMirror.AnnotatedExecutableType of a constructor
invocation. |
AnnotatedTypeMirror.AnnotatedDeclaredType |
getEnclosingType(TypeElement element,
Tree tree)
|
protected AnnotatedTypeMirror.AnnotatedDeclaredType |
getImplicitReceiverType(Tree tree)
|
AnnotatedTypeMirror.AnnotatedExecutableType |
methodFromUse(MethodInvocationTree tree)
Determines the type of the invoked method based on the passed method invocation tree. |
protected void |
postDirectSuperTypes(AnnotatedTypeMirror type,
List<? extends AnnotatedTypeMirror> supertypes)
A callback method for the AnnotatedTypeFactory subtypes to customize directSuperTypes(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final AnnotationMirror POLYNULL
protected final AnnotationMirror NONNULL
protected final AnnotationMirror RAW
protected final AnnotationMirror NULLABLE
protected final AnnotationMirror LAZYNONNULL
| Constructor Detail |
|---|
public NullnessAnnotatedTypeFactory(NullnessSubchecker checker,
CompilationUnitTree root)
NullnessAnnotatedTypeFactory.
| Method Detail |
|---|
protected void annotateImplicit(Element elt,
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 AnnotatedTypeFactoryelt - an elementtype - the type obtained from elt
protected void annotateImplicit(Tree tree,
AnnotatedTypeMirror type)
AnnotatedTypeFactoryTree. By
default, this method does nothing. Subclasses should use this method to
implement implicit annotations specific to their type systems.
annotateImplicit in class AnnotatedTypeFactorytree - an AST nodetype - the type obtained from treeprotected AnnotatedTypeMirror.AnnotatedDeclaredType getImplicitReceiverType(Tree tree)
getImplicitReceiverType in class AnnotatedTypeFactory
public final AnnotatedTypeMirror.AnnotatedDeclaredType getEnclosingType(TypeElement element,
Tree tree)
getEnclosingType in class AnnotatedTypeFactory
protected void postDirectSuperTypes(AnnotatedTypeMirror type,
List<? extends AnnotatedTypeMirror> supertypes)
AnnotatedTypeFactorytype annotations to
supertypes. This allows the type and its supertypes
to have the qualifiers, e.g. the supertypes of an Immutable
type are also Immutable.
postDirectSuperTypes in class AnnotatedTypeFactorytype - the type whose supertypes are desiredsupertypes - the supertypes as specified by the base AnnotatedTypeFactorypublic AnnotatedTypeMirror.AnnotatedExecutableType methodFromUse(MethodInvocationTree tree)
AnnotatedTypeFactoryAnnotatedTypes.asMemberOf(AnnotatedTypeMirror, Element), and
customization based on receiver type should be in accordance to its
specification.
methodFromUse in class AnnotatedTypeFactorytree - the method invocation treepublic AnnotatedTypeMirror.AnnotatedExecutableType constructorFromUse(NewClassTree tree)
AnnotatedTypeFactoryAnnotatedTypeMirror.AnnotatedExecutableType of a constructor
invocation. Note that this is different than calling
AnnotatedTypeFactory.getAnnotatedType(Tree) or
AnnotatedTypeFactory.fromExpression(ExpressionTree) on the constructor invocation;
those determine the type of the result of invoking the
constructor, which is probably an AnnotatedTypeMirror.AnnotatedDeclaredType.
constructorFromUse in class AnnotatedTypeFactorytree - a constructor invocationprotected AnnotationMirror aliasedAnnotation(AnnotationMirror a)
aliasedAnnotation in class AnnotatedTypeFactory
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||