Class AnnotatedTypes


  • public class AnnotatedTypes
    extends Object
    Class that can take an AnnotatedType and return a unique string representation of that type
    Author:
    Stuart Douglas
    • Method Detail

      • createTypeId

        public static <X> String createTypeId​(javax.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:
      • 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
        Type Parameters:
        X -
        Parameters:
        annotatedType -
        Returns:
      • createFieldId

        public static <X> String createFieldId​(javax.enterprise.inject.spi.AnnotatedField<X> field)
      • createCallableId

        public static <X> String createCallableId​(javax.enterprise.inject.spi.AnnotatedCallable<X> method)
      • createMethodId

        public static <X> String createMethodId​(Method method,
                                                Set<Annotation> annotations,
                                                List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
      • createConstructorId

        public static <X> String createConstructorId​(Constructor<X> constructor,
                                                     Set<Annotation> annotations,
                                                     List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
      • createParameterListId

        public static <X> String createParameterListId​(List<javax.enterprise.inject.spi.AnnotatedParameter<X>> parameters)
      • createParameterId

        public static <X> String createParameterId​(javax.enterprise.inject.spi.AnnotatedParameter<X> annotatedParameter)
      • compareAnnotatedParameters

        public static boolean compareAnnotatedParameters​(javax.enterprise.inject.spi.AnnotatedParameter<?> p1,
                                                         javax.enterprise.inject.spi.AnnotatedParameter<?> p2)
        Compares two annotated parameters and returns true if they are equal
      • compareAnnotatedField

        public static boolean compareAnnotatedField​(javax.enterprise.inject.spi.AnnotatedField<?> f1,
                                                    javax.enterprise.inject.spi.AnnotatedField<?> f2)
      • compareAnnotatedCallable

        public static boolean compareAnnotatedCallable​(javax.enterprise.inject.spi.AnnotatedCallable<?> m1,
                                                       javax.enterprise.inject.spi.AnnotatedCallable<?> m2)
      • compareAnnotatedTypes

        public static boolean compareAnnotatedTypes​(javax.enterprise.inject.spi.AnnotatedType<?> t1,
                                                    javax.enterprise.inject.spi.AnnotatedType<?> t2)
        Compares two annotated types and returns true if they are the same
      • getDeclaringAnnotatedType

        public static javax.enterprise.inject.spi.AnnotatedType<?> getDeclaringAnnotatedType​(javax.enterprise.inject.spi.Annotated annotated)
        Returns the declaring AnnotatedType of a given annotated. For an AnnotatedMember, AnnotatedMember.getDeclaringType() is returned. For an AnnotatedParameter, the declaring annotated type of AnnotatedParameter.getDeclaringCallable() is returned. If the parameter is an AnnotatedType, it is returned.
        Throws:
        IllegalArgumentException - if the annotated parameter is an unknown non-standard Annotated subclass.