|
|||||||||
| 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
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.
| Field Summary | |
|---|---|
protected AnnotationMirror |
NONNULL
Represents the Nullness Checker qualifiers |
protected AnnotationMirror |
NULLABLE
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 Summary | |
|---|---|
NullnessAnnotatedTypeFactory(NullnessChecker checker,
CompilationUnitTree root)
Creates a NullnessAnnotatedTypeFactory. |
|
| Method Summary | |
|---|---|
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. |
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 NONNULL
protected final AnnotationMirror RAW
protected final AnnotationMirror NULLABLE
| Constructor Detail |
|---|
public NullnessAnnotatedTypeFactory(NullnessChecker 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
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 tree
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||