Package edu.umd.cs.findbugs.ba
Interface INullnessAnnotationDatabase
-
- All Known Implementing Classes:
NullnessAnnotationDatabase
,TypeQualifierNullnessAnnotationDatabase
public interface INullnessAnnotationDatabase
Interface for querying nullness annotations on methods, fields, and parameters.- Author:
- David Hovemeyer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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 mSig, boolean isStatic, NullnessAnnotation annotation)
Add a method annotation to the database.void
addMethodParameterAnnotation(java.lang.String cName, java.lang.String mName, java.lang.String mSig, boolean isStatic, int param, NullnessAnnotation annotation)
Add a method parameter annotation to the database.NullnessAnnotation
getResolvedAnnotation(java.lang.Object o, boolean getMinimal)
Get a resolved NullnessAnnotation on given XMethod, XField, or XMethodParameter.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.
-
-
-
Method Detail
-
parameterMustBeNonNull
boolean parameterMustBeNonNull(XMethod m, int param)
Determine whether given parameter must be non-null.- Parameters:
m
- a methodparam
- parameter (0 == first parameter)- Returns:
- true if the parameter must be non-null, false otherwise
-
getResolvedAnnotation
@CheckForNull NullnessAnnotation getResolvedAnnotation(java.lang.Object o, boolean getMinimal)
Get a resolved NullnessAnnotation on given XMethod, XField, or XMethodParameter.- Parameters:
o
- an XMethod, XField, or XMethodParametergetMinimal
- TODO: what does this mean?- Returns:
- resolved NullnessAnnotation
-
loadAuxiliaryAnnotations
void loadAuxiliaryAnnotations()
Load "built-in" annotations that might not be evident from the analyzed/referenced code.
-
addFieldAnnotation
void addFieldAnnotation(@DottedClassName java.lang.String cName, java.lang.String mName, java.lang.String mSig, boolean isStatic, NullnessAnnotation annotation)
Add a field annotation to the database.- Parameters:
cName
- dotted class namemName
- field namemSig
- field signatureisStatic
- true if field is static, false otherwiseannotation
- NullnessAnnotation to add
-
addMethodAnnotation
void addMethodAnnotation(@DottedClassName java.lang.String cName, java.lang.String mName, java.lang.String mSig, boolean isStatic, NullnessAnnotation annotation)
Add a method annotation to the database.- Parameters:
cName
- dotted class namemName
- method namemSig
- method signatureisStatic
- true if method is static, false otherwiseannotation
- NullnessAnnotation to add
-
addMethodParameterAnnotation
void addMethodParameterAnnotation(@DottedClassName java.lang.String cName, java.lang.String mName, java.lang.String mSig, boolean isStatic, int param, NullnessAnnotation annotation)
Add a method parameter annotation to the database.- Parameters:
cName
- dotted class namemName
- method namemSig
- method signatureisStatic
- true if method is static, false otherwiseparam
- parameter (0 == first parameter)annotation
- the NullnessAnnotation to add
-
addDefaultAnnotation
void addDefaultAnnotation(AnnotationDatabase.Target target, @DottedClassName java.lang.String c, NullnessAnnotation n)
Add a default annotation to the database.- Parameters:
target
- one of AnnotationDatabase.METHOD, AnnotationDatabase.FIELD, AnnotationDatabase.PARAMETER, or AnnotationDatabase.ANYc
- dotted class name of class default annotation pertains ton
- the default NullnessAnnotation
-
-