public final class Annotateds extends Object
Utilities for working with Annotated
s.
Includes utilities to check the equality of and create unique id's for
Annotated
instances.
Modifier and Type | Method and Description |
---|---|
static boolean |
compareAnnotatedCallable(javax.enterprise.inject.spi.AnnotatedCallable<?> m1,
javax.enterprise.inject.spi.AnnotatedCallable<?> m2)
Compare
AnnotatedCallable s for equality. |
static boolean |
compareAnnotatedField(javax.enterprise.inject.spi.AnnotatedField<?> f1,
javax.enterprise.inject.spi.AnnotatedField<?> f2)
Compares
AnnotatedField s for equality. |
static boolean |
compareAnnotatedTypes(javax.enterprise.inject.spi.AnnotatedType<?> t1,
javax.enterprise.inject.spi.AnnotatedType<?> t2)
Compares two
AnnotatedType s for equality. |
static <X> String |
createCallableId(javax.enterprise.inject.spi.AnnotatedCallable<X> method)
Generates a deterministic signature for an
AnnotatedCallable . |
static <X> String |
createConstructorId(Constructor<X> constructor,
Set<java.lang.annotation.Annotation> annotations,
List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
Creates a deterministic signature for a
Constructor . |
static <X> String |
createFieldId(javax.enterprise.inject.spi.AnnotatedField<X> field)
Generates a deterministic signature for an
AnnotatedField . |
static <X> String |
createFieldId(Field field,
Collection<java.lang.annotation.Annotation> annotations)
Creates a deterministic signature for a
Field . |
static <X> String |
createMethodId(Method method,
Set<java.lang.annotation.Annotation> annotations,
List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
Creates a deterministic signature for a
Method . |
static <X> String |
createParameterId(javax.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)
Creates a string representation of an
AnnotatedParameter . |
static <X> String |
createParameterId(Type type,
Set<java.lang.annotation.Annotation> annotations)
Creates a string representation of a given type and set of annotations.
|
static <X> String |
createParameterListId(List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
Generates a unique string representation of a list of
AnnotatedParameter s. |
static <X> String |
createTypeId(javax.enterprise.inject.spi.AnnotatedType<X> annotatedType)
Generates a deterministic signature for an
AnnotatedType . |
static <X> String |
createTypeId(Class<X> clazz,
Collection<java.lang.annotation.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.
|
public static <X> String createTypeId(javax.enterprise.inject.spi.AnnotatedType<X> annotatedType)
AnnotatedType
. Two
AnnotatedType
s 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.annotatedType
- The type to generate a signature forpublic static <X> String createTypeId(Class<X> clazz, Collection<java.lang.annotation.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)
annotations
, methods
, fields
and
constructors
argumentsclazz
- The java class typeannotations
- 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 signaturepublic static <X> String createFieldId(javax.enterprise.inject.spi.AnnotatedField<X> field)
AnnotatedField
. Two
AnnotatedField
s that have the same annotations and
underlying field will generate the same signature.public static <X> String createFieldId(Field field, Collection<java.lang.annotation.Annotation> annotations)
Field
.field
- The field to generate the signature forannotations
- The annotations to include in the signaturepublic static <X> String createCallableId(javax.enterprise.inject.spi.AnnotatedCallable<X> method)
AnnotatedCallable
. Two
AnnotatedCallable
s that have the same annotations and
underlying callable will generate the same signature.public static <X> String createMethodId(Method method, Set<java.lang.annotation.Annotation> annotations, List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
Method
.method
- The method to generate the signature forannotations
- The annotations to include in the signatureparameters
- The AnnotatedParameter
s to include in the
signaturepublic static <X> String createConstructorId(Constructor<X> constructor, Set<java.lang.annotation.Annotation> annotations, List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
Constructor
.constructor
- The constructor to generate the signature forannotations
- The annotations to include in the signatureparameters
- The AnnotatedParameter
s to include in the
signaturepublic static <X> String createParameterListId(List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
AnnotatedParameter
s.public static <X> String createParameterId(javax.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)
AnnotatedParameter
.public static <X> String createParameterId(Type type, Set<java.lang.annotation.Annotation> annotations)
public static boolean compareAnnotatedField(javax.enterprise.inject.spi.AnnotatedField<?> f1, javax.enterprise.inject.spi.AnnotatedField<?> f2)
Compares AnnotatedField
s for equality.
Two AnnotatedField
s are considered equal if they have the same
underlying field and annotations.
public static boolean compareAnnotatedCallable(javax.enterprise.inject.spi.AnnotatedCallable<?> m1, javax.enterprise.inject.spi.AnnotatedCallable<?> m2)
Compare AnnotatedCallable
s for equality.
Two AnnotatedCallable
s are considered equal if they have the same
underlying callable and annotations.
public static boolean compareAnnotatedTypes(javax.enterprise.inject.spi.AnnotatedType<?> t1, javax.enterprise.inject.spi.AnnotatedType<?> t2)
Compares two AnnotatedType
s for equality.
Two AnnotatedType
s are considered equal if they have the same
underlying type and annotations, and all members have the same
annotations.
Copyright © 2015 The Apache Software Foundation. All rights reserved.