public class TypeQualifierNullnessAnnotationDatabase extends java.lang.Object implements INullnessAnnotationDatabase
Modifier and Type | Field and Description |
---|---|
TypeQualifierValue<javax.annotation.Nonnull> |
nonnullTypeQualifierValue |
Constructor and Description |
---|
TypeQualifierNullnessAnnotationDatabase() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultAnnotation(AnnotationDatabase.Target target,
java.lang.String c,
NullnessAnnotation n)
Add a default annotation to the database.
|
void |
addFieldAnnotation(java.lang.String cName,
java.lang.String mName,
java.lang.String mSig,
boolean isStatic,
NullnessAnnotation annotation)
Add a field annotation to the database.
|
void |
addMethodAnnotation(java.lang.String cName,
java.lang.String mName,
java.lang.String sig,
boolean isStatic,
NullnessAnnotation annotation)
Add a method annotation to the database.
|
void |
addMethodParameterAnnotation(java.lang.String cName,
java.lang.String mName,
java.lang.String sig,
boolean isStatic,
int param,
NullnessAnnotation annotation)
Add a method parameter annotation to the database.
|
static boolean |
assertsFirstParameterIsNonnull(XMethod m) |
NullnessAnnotation |
getDirectAnnotation(java.lang.Object o) |
NullnessAnnotation |
getInheritedAnnotation(XMethod m) |
NullnessAnnotation |
getInheritedAnnotation(XMethod m,
int parameter) |
NullnessAnnotation |
getResolvedAnnotation(java.lang.Object o,
boolean getMinimal)
Get a resolved NullnessAnnotation on given XMethod, XField, or
XMethodParameter.
|
XMethod |
getXMethod(java.lang.String cName,
java.lang.String mName,
java.lang.String sig,
boolean isStatic) |
void |
loadAuxiliaryAnnotations()
Load "built-in" annotations that might not be evident from the
analyzed/referenced code.
|
boolean |
parameterMustBeNonNull(XMethod m,
int param)
Determine whether given parameter must be non-null.
|
public final TypeQualifierValue<javax.annotation.Nonnull> nonnullTypeQualifierValue
public TypeQualifierNullnessAnnotationDatabase()
public NullnessAnnotation getResolvedAnnotation(java.lang.Object o, boolean getMinimal)
INullnessAnnotationDatabase
getResolvedAnnotation
in interface INullnessAnnotationDatabase
o
- an XMethod, XField, or XMethodParametergetMinimal
- TODO: what does this mean?@CheckForNull public NullnessAnnotation getInheritedAnnotation(XMethod m, int parameter)
@CheckForNull public NullnessAnnotation getInheritedAnnotation(XMethod m)
@CheckForNull public NullnessAnnotation getDirectAnnotation(java.lang.Object o)
public static boolean assertsFirstParameterIsNonnull(XMethod m)
public boolean parameterMustBeNonNull(XMethod m, int param)
INullnessAnnotationDatabase
parameterMustBeNonNull
in interface INullnessAnnotationDatabase
m
- a methodparam
- parameter (0 == first parameter)public void addDefaultAnnotation(AnnotationDatabase.Target target, java.lang.String c, NullnessAnnotation n)
INullnessAnnotationDatabase
addDefaultAnnotation
in interface INullnessAnnotationDatabase
target
- one of AnnotationDatabase.METHOD, AnnotationDatabase.FIELD,
AnnotationDatabase.PARAMETER, or AnnotationDatabase.ANYc
- dotted class name of class default annotation pertains ton
- the default NullnessAnnotationpublic void addFieldAnnotation(java.lang.String cName, java.lang.String mName, java.lang.String mSig, boolean isStatic, NullnessAnnotation annotation)
INullnessAnnotationDatabase
addFieldAnnotation
in interface INullnessAnnotationDatabase
cName
- dotted class namemName
- field namemSig
- field signatureisStatic
- true if field is static, false otherwiseannotation
- NullnessAnnotation to add@CheckForNull public XMethod getXMethod(java.lang.String cName, java.lang.String mName, java.lang.String sig, boolean isStatic)
public void addMethodAnnotation(java.lang.String cName, java.lang.String mName, java.lang.String sig, boolean isStatic, NullnessAnnotation annotation)
INullnessAnnotationDatabase
addMethodAnnotation
in interface INullnessAnnotationDatabase
cName
- dotted class namemName
- method namesig
- method signatureisStatic
- true if method is static, false otherwiseannotation
- NullnessAnnotation to addpublic void addMethodParameterAnnotation(@DottedClassName java.lang.String cName, java.lang.String mName, java.lang.String sig, boolean isStatic, int param, NullnessAnnotation annotation)
INullnessAnnotationDatabase
addMethodParameterAnnotation
in interface INullnessAnnotationDatabase
cName
- dotted class namemName
- method namesig
- method signatureisStatic
- true if method is static, false otherwiseparam
- parameter (0 == first parameter)annotation
- the NullnessAnnotation to addpublic void loadAuxiliaryAnnotations()
INullnessAnnotationDatabase
loadAuxiliaryAnnotations
in interface INullnessAnnotationDatabase
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.