Package org.jboss.weld.util
Class AnnotatedTypes
- java.lang.Object
-
- org.jboss.weld.util.AnnotatedTypes
-
public class AnnotatedTypes extends Object
Class that can take an AnnotatedType and return a unique string representation of that type- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description static Set<Class<? extends Annotation>>
TRIM_META_ANNOTATIONS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
compareAnnotatedCallable(jakarta.enterprise.inject.spi.AnnotatedCallable<?> m1, jakarta.enterprise.inject.spi.AnnotatedCallable<?> m2)
static boolean
compareAnnotatedField(jakarta.enterprise.inject.spi.AnnotatedField<?> f1, jakarta.enterprise.inject.spi.AnnotatedField<?> f2)
static boolean
compareAnnotatedParameters(jakarta.enterprise.inject.spi.AnnotatedParameter<?> p1, jakarta.enterprise.inject.spi.AnnotatedParameter<?> p2)
Compares two annotated parameters and returns true if they are equalstatic boolean
compareAnnotatedTypes(jakarta.enterprise.inject.spi.AnnotatedType<?> t1, jakarta.enterprise.inject.spi.AnnotatedType<?> t2)
Compares two annotated types and returns true if they are the sameprotected static String
createAnnotationCollectionId(Collection<Annotation> annotations)
static <X> String
createCallableId(jakarta.enterprise.inject.spi.AnnotatedCallable<X> method)
static <X> String
createConstructorId(Constructor<X> constructor, Set<Annotation> annotations, List<jakarta.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
static <X> String
createFieldId(jakarta.enterprise.inject.spi.AnnotatedField<X> field)
static <X> String
createFieldId(Field field, Collection<Annotation> annotations)
static <X> String
createMethodId(Method method, Set<Annotation> annotations, List<jakarta.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
static <X> String
createParameterId(jakarta.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)
static <X> String
createParameterId(Type type, Set<Annotation> annotations)
static <X> String
createParameterListId(List<jakarta.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
static <X> String
createTypeId(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType)
Generates a unique signature for an annotated type.static jakarta.enterprise.inject.spi.AnnotatedType<?>
getDeclaringAnnotatedType(jakarta.enterprise.inject.spi.Annotated annotated)
Returns the declaringAnnotatedType
of a given annotated.static boolean
hasBeanDefiningAnnotation(jakarta.enterprise.inject.spi.AnnotatedType<?> annotatedType)
static boolean
hasBeanDefiningAnnotation(jakarta.enterprise.inject.spi.AnnotatedType<?> annotatedType, Set<Class<? extends Annotation>> metaAnnotations)
static String
hash(String id)
-
-
-
Field Detail
-
TRIM_META_ANNOTATIONS
public static final Set<Class<? extends Annotation>> TRIM_META_ANNOTATIONS
-
-
Method Detail
-
createTypeId
public static <X> String createTypeId(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType)
Generates a unique signature for an annotated type. Members without annotations are omitted to reduce the length of the signature- Type Parameters:
X
-- Parameters:
annotatedType
-- Returns:
- hash of a signature for a concrete annotated type
-
createAnnotationCollectionId
protected static String createAnnotationCollectionId(Collection<Annotation> annotations)
-
createFieldId
public static <X> String createFieldId(jakarta.enterprise.inject.spi.AnnotatedField<X> field)
-
createFieldId
public static <X> String createFieldId(Field field, Collection<Annotation> annotations)
-
createCallableId
public static <X> String createCallableId(jakarta.enterprise.inject.spi.AnnotatedCallable<X> method)
-
createMethodId
public static <X> String createMethodId(Method method, Set<Annotation> annotations, List<jakarta.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
-
createConstructorId
public static <X> String createConstructorId(Constructor<X> constructor, Set<Annotation> annotations, List<jakarta.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
-
createParameterListId
public static <X> String createParameterListId(List<jakarta.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
-
createParameterId
public static <X> String createParameterId(jakarta.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)
-
createParameterId
public static <X> String createParameterId(Type type, Set<Annotation> annotations)
-
compareAnnotatedParameters
public static boolean compareAnnotatedParameters(jakarta.enterprise.inject.spi.AnnotatedParameter<?> p1, jakarta.enterprise.inject.spi.AnnotatedParameter<?> p2)
Compares two annotated parameters and returns true if they are equal
-
compareAnnotatedField
public static boolean compareAnnotatedField(jakarta.enterprise.inject.spi.AnnotatedField<?> f1, jakarta.enterprise.inject.spi.AnnotatedField<?> f2)
-
compareAnnotatedCallable
public static boolean compareAnnotatedCallable(jakarta.enterprise.inject.spi.AnnotatedCallable<?> m1, jakarta.enterprise.inject.spi.AnnotatedCallable<?> m2)
-
compareAnnotatedTypes
public static boolean compareAnnotatedTypes(jakarta.enterprise.inject.spi.AnnotatedType<?> t1, jakarta.enterprise.inject.spi.AnnotatedType<?> t2)
Compares two annotated types and returns true if they are the same
-
getDeclaringAnnotatedType
public static jakarta.enterprise.inject.spi.AnnotatedType<?> getDeclaringAnnotatedType(jakarta.enterprise.inject.spi.Annotated annotated)
Returns the declaringAnnotatedType
of a given annotated. For anAnnotatedMember
,AnnotatedMember.getDeclaringType()
is returned. For anAnnotatedParameter
, the declaring annotated type ofAnnotatedParameter.getDeclaringCallable()
is returned. If the parameter is anAnnotatedType
, it is returned.- Throws:
IllegalArgumentException
- if the annotated parameter is an unknown non-standardAnnotated
subclass.
-
hasBeanDefiningAnnotation
public static boolean hasBeanDefiningAnnotation(jakarta.enterprise.inject.spi.AnnotatedType<?> annotatedType)
-
hasBeanDefiningAnnotation
public static boolean hasBeanDefiningAnnotation(jakarta.enterprise.inject.spi.AnnotatedType<?> annotatedType, Set<Class<? extends Annotation>> metaAnnotations)
-
-