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 booleancompareAnnotatedCallable(AnnotatedCallable<?> m1, AnnotatedCallable<?> m2)static booleancompareAnnotatedField(AnnotatedField<?> f1, AnnotatedField<?> f2)static booleancompareAnnotatedParameters(AnnotatedParameter<?> p1, AnnotatedParameter<?> p2)Compares two annotated parameters and returns true if they are equalstatic booleancompareAnnotatedTypes(AnnotatedType<?> t1, AnnotatedType<?> t2)Compares two annotated types and returns true if they are the sameprotected static StringcreateAnnotationCollectionId(Collection<Annotation> annotations)static <X> StringcreateCallableId(AnnotatedCallable<X> method)static <X> StringcreateConstructorId(Constructor<X> constructor, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)static <X> StringcreateFieldId(Field field, Collection<Annotation> annotations)static <X> StringcreateFieldId(AnnotatedField<X> field)static <X> StringcreateMethodId(Method method, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)static <X> StringcreateParameterId(Type type, Set<Annotation> annotations)static <X> StringcreateParameterId(AnnotatedParameter<X> annotatedParameter)static <X> StringcreateParameterListId(List<AnnotatedParameter<X>> parameters)static <X> StringcreateTypeId(AnnotatedType<X> annotatedType)Generates a unique signature for an annotated type.static AnnotatedType<?>getDeclaringAnnotatedType(Annotated annotated)Returns the declaringAnnotatedTypeof a given annotated.static booleanhasBeanDefiningAnnotation(AnnotatedType<?> annotatedType)static booleanhasBeanDefiningAnnotation(AnnotatedType<?> annotatedType, Set<Class<? extends Annotation>> metaAnnotations)static Stringhash(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(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(AnnotatedField<X> field)
-
createFieldId
public static <X> String createFieldId(Field field, Collection<Annotation> annotations)
-
createCallableId
public static <X> String createCallableId(AnnotatedCallable<X> method)
-
createMethodId
public static <X> String createMethodId(Method method, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)
-
createConstructorId
public static <X> String createConstructorId(Constructor<X> constructor, Set<Annotation> annotations, List<AnnotatedParameter<X>> parameters)
-
createParameterListId
public static <X> String createParameterListId(List<AnnotatedParameter<X>> parameters)
-
createParameterId
public static <X> String createParameterId(AnnotatedParameter<X> annotatedParameter)
-
createParameterId
public static <X> String createParameterId(Type type, Set<Annotation> annotations)
-
compareAnnotatedParameters
public static boolean compareAnnotatedParameters(AnnotatedParameter<?> p1, AnnotatedParameter<?> p2)
Compares two annotated parameters and returns true if they are equal
-
compareAnnotatedField
public static boolean compareAnnotatedField(AnnotatedField<?> f1, AnnotatedField<?> f2)
-
compareAnnotatedCallable
public static boolean compareAnnotatedCallable(AnnotatedCallable<?> m1, AnnotatedCallable<?> m2)
-
compareAnnotatedTypes
public static boolean compareAnnotatedTypes(AnnotatedType<?> t1, AnnotatedType<?> t2)
Compares two annotated types and returns true if they are the same
-
getDeclaringAnnotatedType
public static AnnotatedType<?> getDeclaringAnnotatedType(Annotated annotated)
Returns the declaringAnnotatedTypeof 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-standardAnnotatedsubclass.
-
hasBeanDefiningAnnotation
public static boolean hasBeanDefiningAnnotation(AnnotatedType<?> annotatedType)
-
hasBeanDefiningAnnotation
public static boolean hasBeanDefiningAnnotation(AnnotatedType<?> annotatedType, Set<Class<? extends Annotation>> metaAnnotations)
-
-