Class TypeQualifierValue<A extends Annotation>
java.lang.Object
edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue<A>
A TypeQualifierValue is a pair specifying a type qualifier annotation and a
value. Each TypeQualifierValue is effectively a different type qualifier. For
example, if Foo is a type qualifier annotation having an int value, then
Foo(0), Foo(1), etc. are all different type qualifiers which must be checked
separately.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final booleanprivate static final ClassDescriptorprivate static final ClassDescriptorprivate static ThreadLocal<TypeQualifierValue.Data> private final booleanprivate final booleanprivate final booleanfinal Afinal ClassDescriptorprivate final javax.annotation.meta.TypeQualifierValidator<A> final Object -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTypeQualifierValue(ClassDescriptor typeQualifier, Object value) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanValidate(Object constantValue) static voidbooleanstatic Collection<TypeQualifierValue<?>> Get Collection of all known TypeQualifierValues.static Collection<TypeQualifierValue<?>> Get the "complementary" TypeQualifierValues for given exclusive type qualifier.private static <A> Class<A> getQualifierClass(ClassDescriptor typeQualifier) Get the ClassDescriptor which specifies the type qualifier annotation.private static <A extends Annotation>
javax.annotation.meta.TypeQualifierValidator<A> getValidator(Class<? extends javax.annotation.meta.TypeQualifierValidator<A>> checkerClass) static TypeQualifierValue<?> getValue(ClassDescriptor desc, Object value) Given a ClassDescriptor/value pair, return the interned TypeQualifierValue representing that pair.static <A extends Annotation>
TypeQualifierValue<A> inthashCode()static booleanDetermine whether or not given TypeQualifierValue has multiple variants.booleanReturn whether or not this TypeQualifierValue denotes an exclusive qualifier.booleanReturn whether or not this TypeQualifierValue denotes an exhaustive qualifier.booleanReturn whether or not this TypeQualifierValue denotes a strict qualifier.(package private) static byte[]loadClassData(String name) toString()javax.annotation.meta.When
-
Field Details
-
DEBUG
public static final boolean DEBUG -
DEBUG_CLASSLOADING
public static final boolean DEBUG_CLASSLOADING -
EXCLUSIVE_ANNOTATION
-
EXHAUSTIVE_ANNOTATION
-
typeQualifier
-
typeQualifierClass
-
proxy
-
value
-
isStrict
private final boolean isStrict -
isExclusive
private final boolean isExclusive -
isExhaustive
private final boolean isExhaustive -
validator
@CheckForNull private final javax.annotation.meta.TypeQualifierValidator<A extends Annotation> validator -
instance
-
-
Constructor Details
-
TypeQualifierValue
-
-
Method Details
-
getValidator
private static <A extends Annotation> javax.annotation.meta.TypeQualifierValidator<A> getValidator(Class<? extends javax.annotation.meta.TypeQualifierValidator<A>> checkerClass) throws InstantiationException, IllegalAccessException -
getQualifierClass
private static <A> Class<A> getQualifierClass(ClassDescriptor typeQualifier) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
loadClassData
- Throws:
CheckedAnalysisException
-
clearInstance
public static void clearInstance() -
canValidate
-
validate
-
getValue
@Nonnull public static TypeQualifierValue<?> getValue(ClassDescriptor desc, @CheckForNull Object value) Given a ClassDescriptor/value pair, return the interned TypeQualifierValue representing that pair.- Parameters:
desc- a ClassDescriptor denoting a type qualifier annotationvalue- a value- Returns:
- an interned TypeQualifierValue object
-
getValue
@Nonnull public static <A extends Annotation> TypeQualifierValue<A> getValue(Class<A> clazz, @CheckForNull Object value) -
getAllKnownTypeQualifiers
Get Collection of all known TypeQualifierValues.- Returns:
- Collection of all known TypeQualifierValues
-
getComplementaryExclusiveTypeQualifierValue
public static Collection<TypeQualifierValue<?>> getComplementaryExclusiveTypeQualifierValue(TypeQualifierValue<?> tqv) Get the "complementary" TypeQualifierValues for given exclusive type qualifier.- Parameters:
tqv- a type qualifier (which must be exclusive)- Returns:
- Collection of complementary exclusive type qualifiers
-
hasMultipleVariants
Determine whether or not given TypeQualifierValue has multiple variants. I.e., if Color is a type qualifier having values RED, GREEN, and BLUE, then there are 3 variants, Color(RED), Color(GREEN), and COLOR(BLUE).- Parameters:
tqv- a TypeQualifierValue- Returns:
- true if there are multiple variants of this type qualifier, false otherwise
-
getTypeQualifierClassDescriptor
Get the ClassDescriptor which specifies the type qualifier annotation.- Returns:
- ClassDescriptor which specifies the type qualifier annotation
-
isStrictQualifier
public boolean isStrictQualifier()Return whether or not this TypeQualifierValue denotes a strict qualifier.- Returns:
- true if type qualifier is strict, false otherwise
-
isExclusiveQualifier
public boolean isExclusiveQualifier()Return whether or not this TypeQualifierValue denotes an exclusive qualifier.- Returns:
- true if type qualifier is exclusive, false otherwise
-
isExhaustiveQualifier
public boolean isExhaustiveQualifier()Return whether or not this TypeQualifierValue denotes an exhaustive qualifier.- Returns:
- true if type qualifier is exhaustive, false otherwise
-
hashCode
-
equals
-
toString
-