FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba
Class NullnessAnnotationDatabase

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.AnnotationDatabase<NullnessAnnotation>
      extended by edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase
All Implemented Interfaces:
INullnessAnnotationDatabase

public class NullnessAnnotationDatabase
extends AnnotationDatabase<NullnessAnnotation>
implements INullnessAnnotationDatabase

Author:
pugh

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.findbugs.ba.AnnotationDatabase
AnnotationDatabase.Target
 
Field Summary
 
Fields inherited from class edu.umd.cs.findbugs.ba.AnnotationDatabase
IGNORE_BUILTIN_ANNOTATIONS
 
Constructor Summary
NullnessAnnotationDatabase()
           
 
Method Summary
 void addDefaultAnnotation(AnnotationDatabase.Target target, java.lang.String c, NullnessAnnotation n)
          Add a default annotation to the database.
 void addDefaultMethodAnnotation(java.lang.String name, NullnessAnnotation annotation)
           
 void addFieldAnnotation(java.lang.String name, java.lang.String name2, java.lang.String sig, boolean isStatic, NullnessAnnotation annotation)
          Add a field annotation to the database.
 void addMethodAnnotation(java.lang.String name, java.lang.String name2, java.lang.String sig, boolean isStatic, NullnessAnnotation annotation)
          Add a method annotation to the database.
 void addMethodParameterAnnotation(java.lang.String name, java.lang.String name2, java.lang.String sig, boolean isStatic, int param, NullnessAnnotation annotation)
          Add a method parameter annotation to the database.
static boolean assertsFirstParameterIsNonnull(XMethod m)
           
 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.
 
Methods inherited from class edu.umd.cs.findbugs.ba.AnnotationDatabase
addDirectAnnotation, annotationIsDirect, anyAnnotations, getDirectAnnotation, getUncachedResolvedAnnotation, setAddClassOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullnessAnnotationDatabase

public NullnessAnnotationDatabase()
Method Detail

loadAuxiliaryAnnotations

public void loadAuxiliaryAnnotations()
Description copied from interface: INullnessAnnotationDatabase
Load "built-in" annotations that might not be evident from the analyzed/referenced code.

Specified by:
loadAuxiliaryAnnotations in interface INullnessAnnotationDatabase
Overrides:
loadAuxiliaryAnnotations in class AnnotationDatabase<NullnessAnnotation>

parameterMustBeNonNull

public boolean parameterMustBeNonNull(XMethod m,
                                      int param)
Description copied from interface: INullnessAnnotationDatabase
Determine whether given parameter must be non-null.

Specified by:
parameterMustBeNonNull in interface INullnessAnnotationDatabase
Parameters:
m - a method
param - parameter (0 == first parameter)
Returns:
true if the parameter must be non-null, false otherwise

getResolvedAnnotation

@CheckForNull
public NullnessAnnotation getResolvedAnnotation(java.lang.Object o,
                                                             boolean getMinimal)
Description copied from interface: INullnessAnnotationDatabase
Get a resolved NullnessAnnotation on given XMethod, XField, or XMethodParameter.

Specified by:
getResolvedAnnotation in interface INullnessAnnotationDatabase
Overrides:
getResolvedAnnotation in class AnnotationDatabase<NullnessAnnotation>
Parameters:
o - an XMethod, XField, or XMethodParameter
getMinimal - TODO: what does this mean?
Returns:
resolved NullnessAnnotation

assertsFirstParameterIsNonnull

public static boolean assertsFirstParameterIsNonnull(XMethod m)
Parameters:
m -
Returns:

addDefaultMethodAnnotation

public void addDefaultMethodAnnotation(java.lang.String name,
                                       NullnessAnnotation annotation)
Overrides:
addDefaultMethodAnnotation in class AnnotationDatabase<NullnessAnnotation>

addDefaultAnnotation

public void addDefaultAnnotation(AnnotationDatabase.Target target,
                                 java.lang.String c,
                                 NullnessAnnotation n)
Description copied from interface: INullnessAnnotationDatabase
Add a default annotation to the database.

Specified by:
addDefaultAnnotation in interface INullnessAnnotationDatabase
Overrides:
addDefaultAnnotation in class AnnotationDatabase<NullnessAnnotation>
Parameters:
target - one of AnnotationDatabase.METHOD, AnnotationDatabase.FIELD, AnnotationDatabase.PARAMETER, or AnnotationDatabase.ANY
c - dotted class name of class default annotation pertains to
n - the default NullnessAnnotation

addFieldAnnotation

public void addFieldAnnotation(java.lang.String name,
                               java.lang.String name2,
                               java.lang.String sig,
                               boolean isStatic,
                               NullnessAnnotation annotation)
Description copied from interface: INullnessAnnotationDatabase
Add a field annotation to the database.

Specified by:
addFieldAnnotation in interface INullnessAnnotationDatabase
Overrides:
addFieldAnnotation in class AnnotationDatabase<NullnessAnnotation>
Parameters:
name - dotted class name
name2 - field name
sig - field signature
isStatic - true if field is static, false otherwise
annotation - NullnessAnnotation to add

addMethodAnnotation

public void addMethodAnnotation(java.lang.String name,
                                java.lang.String name2,
                                java.lang.String sig,
                                boolean isStatic,
                                NullnessAnnotation annotation)
Description copied from interface: INullnessAnnotationDatabase
Add a method annotation to the database.

Specified by:
addMethodAnnotation in interface INullnessAnnotationDatabase
Overrides:
addMethodAnnotation in class AnnotationDatabase<NullnessAnnotation>
Parameters:
name - dotted class name
name2 - method name
sig - method signature
isStatic - true if method is static, false otherwise
annotation - NullnessAnnotation to add

addMethodParameterAnnotation

public void addMethodParameterAnnotation(java.lang.String name,
                                         java.lang.String name2,
                                         java.lang.String sig,
                                         boolean isStatic,
                                         int param,
                                         NullnessAnnotation annotation)
Description copied from interface: INullnessAnnotationDatabase
Add a method parameter annotation to the database.

Specified by:
addMethodParameterAnnotation in interface INullnessAnnotationDatabase
Overrides:
addMethodParameterAnnotation in class AnnotationDatabase<NullnessAnnotation>
Parameters:
name - dotted class name
name2 - method name
sig - method signature
isStatic - true if method is static, false otherwise
param - parameter (0 == first parameter)
annotation - the NullnessAnnotation to add

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.