Package edu.umd.cs.findbugs.ba.jsr305
Class TypeQualifierResolver
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.jsr305.TypeQualifierResolver
-
public class TypeQualifierResolver extends java.lang.Object
Resolve annotations into type qualifiers.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static ClassDescriptor
eclipseNonNullByDefault
(package private) static ClassDescriptor
elementTypeDescriptor
private static ClassDescriptor[]
NON_NULL_CLASS_DESCRIPTORS
private static ClassDescriptor[]
NULLABLE_CLASS_DESCRIPTORS
(package private) static ClassDescriptor
typeQualifier
(package private) static ClassDescriptor
typeQualifierDefault
(package private) static ClassDescriptor
typeQualifierNickname
-
Constructor Summary
Constructors Constructor Description TypeQualifierResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
logMissingAnnotationClass(MissingClassException e)
private static void
resolveTypeQualifierDefaults(AnnotationValue value, java.lang.annotation.ElementType defaultFor, java.util.LinkedList<AnnotationValue> result)
Resolve an annotation into AnnotationValues representing any type qualifier(s) the annotation resolves to.static java.util.Collection<AnnotationValue>
resolveTypeQualifierDefaults(java.util.Collection<AnnotationValue> values, java.lang.annotation.ElementType elementType)
Resolve collection of AnnotationValues (which have been used to annotate an AnnotatedObject or method parameter) into collection of resolved type qualifier AnnotationValues.private static void
resolveTypeQualifierNicknames(AnnotationValue value, java.util.LinkedList<AnnotationValue> result, java.util.LinkedList<ClassDescriptor> onStack)
Resolve an annotation into AnnotationValues representing any type qualifier(s) the annotation resolves to.static java.util.Collection<AnnotationValue>
resolveTypeQualifiers(AnnotationValue value)
Resolve an AnnotationValue into a list of AnnotationValues representing type qualifier annotations.static java.util.Collection<AnnotationValue>
resolveTypeQualifiers(java.util.Collection<AnnotationValue> values)
Resolve collection of AnnotationValues (which have been used to annotate an AnnotatedObject or method parameter) into collection of resolved type qualifier AnnotationValues.
-
-
-
Field Detail
-
typeQualifier
static final ClassDescriptor typeQualifier
-
typeQualifierNickname
static final ClassDescriptor typeQualifierNickname
-
typeQualifierDefault
static final ClassDescriptor typeQualifierDefault
-
elementTypeDescriptor
static final ClassDescriptor elementTypeDescriptor
-
eclipseNonNullByDefault
static final ClassDescriptor eclipseNonNullByDefault
-
NON_NULL_CLASS_DESCRIPTORS
private static final ClassDescriptor[] NON_NULL_CLASS_DESCRIPTORS
-
NULLABLE_CLASS_DESCRIPTORS
private static final ClassDescriptor[] NULLABLE_CLASS_DESCRIPTORS
-
-
Method Detail
-
resolveTypeQualifiers
public static java.util.Collection<AnnotationValue> resolveTypeQualifiers(AnnotationValue value)
Resolve an AnnotationValue into a list of AnnotationValues representing type qualifier annotations.- Parameters:
value
- AnnotationValue representing the use of an annotation- Returns:
- Collection of AnnotationValues representing resolved TypeQualifier annotations
-
resolveTypeQualifierDefaults
public static java.util.Collection<AnnotationValue> resolveTypeQualifierDefaults(java.util.Collection<AnnotationValue> values, java.lang.annotation.ElementType elementType)
Resolve collection of AnnotationValues (which have been used to annotate an AnnotatedObject or method parameter) into collection of resolved type qualifier AnnotationValues.- Parameters:
values
- Collection of AnnotationValues used to annotate an AnnotatedObject or method parameter- Returns:
- Collection of resolved type qualifier AnnotationValues
-
resolveTypeQualifierNicknames
private static void resolveTypeQualifierNicknames(AnnotationValue value, java.util.LinkedList<AnnotationValue> result, java.util.LinkedList<ClassDescriptor> onStack)
Resolve an annotation into AnnotationValues representing any type qualifier(s) the annotation resolves to. Detects annotations which are directly marked as TypeQualifier annotations, and also resolves the use of TypeQualifierNickname annotations.- Parameters:
value
- AnnotationValue representing the use of an annotationresult
- LinkedList containing resolved type qualifier AnnotationValuesonStack
- stack of annotations being processed; used to detect cycles in type qualifier nicknames
-
logMissingAnnotationClass
public static void logMissingAnnotationClass(MissingClassException e)
-
resolveTypeQualifiers
public static java.util.Collection<AnnotationValue> resolveTypeQualifiers(java.util.Collection<AnnotationValue> values)
Resolve collection of AnnotationValues (which have been used to annotate an AnnotatedObject or method parameter) into collection of resolved type qualifier AnnotationValues.- Parameters:
values
- Collection of AnnotationValues used to annotate an AnnotatedObject or method parameter- Returns:
- Collection of resolved type qualifier AnnotationValues
-
resolveTypeQualifierDefaults
private static void resolveTypeQualifierDefaults(AnnotationValue value, java.lang.annotation.ElementType defaultFor, java.util.LinkedList<AnnotationValue> result)
Resolve an annotation into AnnotationValues representing any type qualifier(s) the annotation resolves to. Detects annotations which are directly marked as TypeQualifier annotations, and also resolves the use of TypeQualifierNickname annotations.- Parameters:
value
- AnnotationValue representing the use of an annotationresult
- LinkedList containing resolved type qualifier AnnotationValues
-
-