Package org.infinispan.cdi.common.util
Class Annotateds
- java.lang.Object
-
- org.infinispan.cdi.common.util.Annotateds
-
public class Annotateds extends Object
Utilities for working with
Annotateds.Includes utilities to check the equality of and create unique id's for
Annotatedinstances.- Author:
- Stuart Douglas <stuart@baileyroberts.com.au>
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <X> StringcreateCallableId(javax.enterprise.inject.spi.AnnotatedCallable<X> method)Generates a deterministic signature for anAnnotatedCallable.static <X> StringcreateFieldId(Field field, Collection<Annotation> annotations)Creates a deterministic signature for aField.static <X> StringcreateFieldId(javax.enterprise.inject.spi.AnnotatedField<X> field)Generates a deterministic signature for anAnnotatedField.static <X> StringcreateParameterId(Type type, Set<Annotation> annotations)Creates a string representation of a given type and set of annotations.static <X> StringcreateParameterId(javax.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)Creates a string representation of anAnnotatedParameter.static <X> StringcreateParameterListId(List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)Generates a unique string representation of a list ofAnnotatedParameters.static <X> StringcreateTypeId(Class<X> clazz, Collection<Annotation> annotations, Collection<javax.enterprise.inject.spi.AnnotatedMethod<? super X>> methods, Collection<javax.enterprise.inject.spi.AnnotatedField<? super X>> fields, Collection<javax.enterprise.inject.spi.AnnotatedConstructor<X>> constructors)Generates a unique signature for a concrete class.static <X> StringcreateTypeId(javax.enterprise.inject.spi.AnnotatedType<X> annotatedType)Generates a deterministic signature for anAnnotatedType.
-
-
-
Method Detail
-
createTypeId
public static <X> String createTypeId(javax.enterprise.inject.spi.AnnotatedType<X> annotatedType)
Generates a deterministic signature for anAnnotatedType. TwoAnnotatedTypes that have the same annotations and underlying type will generate the same signature. This can be used to create a unique bean id for a passivation capable bean that is added directly through the SPI.- Parameters:
annotatedType- The type to generate a signature for- Returns:
- A string representation of the annotated type
-
createTypeId
public static <X> String createTypeId(Class<X> clazz, Collection<Annotation> annotations, Collection<javax.enterprise.inject.spi.AnnotatedMethod<? super X>> methods, Collection<javax.enterprise.inject.spi.AnnotatedField<? super X>> fields, Collection<javax.enterprise.inject.spi.AnnotatedConstructor<X>> constructors)
Generates a unique signature for a concrete class. Annotations are not read directly from the class, but are read from theannotations,methods,fieldsandconstructorsarguments- Parameters:
clazz- The java class tyoeannotations- Annotations present on the java classmethods- The AnnotatedMethods to include in the signaturefields- The AnnotatedFields to include in the signatureconstructors- The AnnotatedConstructors to include in the signature- Returns:
- A string representation of the type
-
createFieldId
public static <X> String createFieldId(javax.enterprise.inject.spi.AnnotatedField<X> field)
Generates a deterministic signature for anAnnotatedField. TwoAnnotatedFields that have the same annotations and underlying field will generate the same signature.
-
createFieldId
public static <X> String createFieldId(Field field, Collection<Annotation> annotations)
Creates a deterministic signature for aField.- Parameters:
field- The field to generate the signature forannotations- The annotations to include in the signature
-
createCallableId
public static <X> String createCallableId(javax.enterprise.inject.spi.AnnotatedCallable<X> method)
Generates a deterministic signature for anAnnotatedCallable. TwoAnnotatedCallables that have the same annotations and underlying callable will generate the same signature.
-
createParameterListId
public static <X> String createParameterListId(List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
Generates a unique string representation of a list ofAnnotatedParameters.
-
createParameterId
public static <X> String createParameterId(javax.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)
Creates a string representation of anAnnotatedParameter.
-
createParameterId
public static <X> String createParameterId(Type type, Set<Annotation> annotations)
Creates a string representation of a given type and set of annotations.
-
-