FindBugs™ 1.3.4

edu.umd.cs.findbugs.ba.jsr305
Class TypeQualifierApplications

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.jsr305.TypeQualifierApplications

public class TypeQualifierApplications
extends java.lang.Object

Figure out where and how type qualifier annotations are applied.

Author:
William Pugh, David Hovemeyer

Constructor Summary
TypeQualifierApplications()
           
 
Method Summary
static void clearInstance()
           
static TypeQualifierAnnotation constructTypeQualifierAnnotation(AnnotationValue v)
          Resolve a raw AnnotationValue into a TypeQualifierAnnotation.
static void constructTypeQualifierAnnotation(java.util.Set<TypeQualifierAnnotation> set, AnnotationValue v)
          Resolve a raw AnnotationValue into a TypeQualifierAnnotation, storing result in given Set.
static java.util.Collection<TypeQualifierAnnotation> getApplicableApplications(AnnotatedObject o)
          Get the Collection of resolved TypeQualifierAnnotations representing directly applied and default (outer scope) type qualifier annotations for given AnnotatedObject.
static java.util.Collection<TypeQualifierAnnotation> getApplicableApplications(XMethod o, int parameter)
          Get the Collection of resolved TypeQualifierAnnotations representing directly applied and default (outer scope) type qualifier annotations for given method parameter.
static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(AnnotatedObject o, TypeQualifierValue typeQualifierValue)
          Get the effective TypeQualifierAnnotation on given AnnotatedObject.
static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(XMethod xmethod, int parameter, TypeQualifierValue typeQualifierValue)
          Get the effective TypeQualifierAnnotation on given method parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeQualifierApplications

public TypeQualifierApplications()
Method Detail

clearInstance

public static void clearInstance()

constructTypeQualifierAnnotation

public static TypeQualifierAnnotation constructTypeQualifierAnnotation(AnnotationValue v)
Resolve a raw AnnotationValue into a TypeQualifierAnnotation.

Parameters:
v - a raw AnnotationValue
Returns:
a constructed TypeQualifierAnnotation

constructTypeQualifierAnnotation

public static void constructTypeQualifierAnnotation(java.util.Set<TypeQualifierAnnotation> set,
                                                    AnnotationValue v)
Resolve a raw AnnotationValue into a TypeQualifierAnnotation, storing result in given Set.

Parameters:
set - Set of resolved TypeQualifierAnnotations
v - a raw AnnotationValue

getApplicableApplications

public static java.util.Collection<TypeQualifierAnnotation> getApplicableApplications(AnnotatedObject o)
Get the Collection of resolved TypeQualifierAnnotations representing directly applied and default (outer scope) type qualifier annotations for given AnnotatedObject.

NOTE: does not properly account for inherited annotations on instance methods. It is ok to call this method to find out generally-relevant TypeQualifierAnnotations, but not to find the effective TypeQualifierAnnotation.

Parameters:
o - an AnnotatedObject
Returns:
Collection of TypeQualifierAnnotations applicable to the AnnotatedObject

getApplicableApplications

public static java.util.Collection<TypeQualifierAnnotation> getApplicableApplications(XMethod o,
                                                                                      int parameter)
Get the Collection of resolved TypeQualifierAnnotations representing directly applied and default (outer scope) type qualifier annotations for given method parameter.

NOTE: does not properly account for inherited annotations on instance method parameters. It is ok to call this method to find out generally-relevant TypeQualifierAnnotations, but not to find the effective TypeQualifierAnnotation.

Parameters:
o - a method
parameter - a parameter (0 == first parameter)
Returns:
Collection of TypeQualifierAnnotations applicable to the method parameter

getEffectiveTypeQualifierAnnotation

public static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(AnnotatedObject o,
                                                                          TypeQualifierValue typeQualifierValue)
Get the effective TypeQualifierAnnotation on given AnnotatedObject. Takes into account inherited and default (outer scope) annotations.

Parameters:
o - an AnnotatedObject
typeQualifierValue - a TypeQualifierValue specifying kind of annotation we want to look up
Returns:
the effective TypeQualifierAnnotation, or null if there is no effective TypeQualifierAnnotation on this AnnotatedObject

getEffectiveTypeQualifierAnnotation

@CheckForNull
public static TypeQualifierAnnotation getEffectiveTypeQualifierAnnotation(XMethod xmethod,
                                                                                       int parameter,
                                                                                       TypeQualifierValue typeQualifierValue)
Get the effective TypeQualifierAnnotation on given method parameter. Takes into account inherited and default (outer scope) annotations.

Parameters:
xmethod - a method
parameter - a parameter (0 == first parameter)
typeQualifierValue - the kind of TypeQualifierValue we are looking for
Returns:
effective TypeQualifierAnnotation on the parameter, or null if there is no effective TypeQualifierAnnotation

FindBugs™ 1.3.4

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