Class AbstractEnhancedAnnotated<T,S>

java.lang.Object
org.jboss.weld.annotated.enhanced.jlr.AbstractEnhancedAnnotated<T,S>
Type Parameters:
T -
S -
All Implemented Interfaces:
jakarta.enterprise.inject.spi.Annotated, EnhancedAnnotated<T,S>
Direct Known Subclasses:
AbstractEnhancedAnnotatedMember, EnhancedAnnotatedParameterImpl, EnhancedAnnotatedTypeImpl

public abstract class AbstractEnhancedAnnotated<T,S> extends Object implements EnhancedAnnotated<T,S>
Represents functionality common for all annotated items, mainly different mappings of the annotations and meta-annotations

AbstractAnnotatedItem is an immutable class and therefore threadsafe

Author:
Pete Muir, Nicklas Karlsson
See Also:
  • Constructor Details

    • AbstractEnhancedAnnotated

      public AbstractEnhancedAnnotated(jakarta.enterprise.inject.spi.Annotated annotated, Map<Class<? extends Annotation>,Annotation> annotationMap, Map<Class<? extends Annotation>,Annotation> declaredAnnotationMap, ClassTransformer classTransformer)
      Constructor

      Also builds the meta-annotation map. Throws a NullPointerException if trying to register a null map

      Parameters:
      annotationMap - A map of annotation to register
  • Method Details

    • buildAnnotationMap

      protected static Map<Class<? extends Annotation>,Annotation> buildAnnotationMap(Iterable<Annotation> annotations)
      Builds the annotation map (annotation type -> annotation)
      Parameters:
      annotations - The array of annotations to map
      Returns:
      The annotation map
    • addMetaAnnotations

      protected static void addMetaAnnotations(SetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap, Annotation annotation, Iterable<Annotation> metaAnnotations, boolean declared)
    • processMetaAnnotations

      protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap, Collection<Annotation> annotations, ClassTransformer classTransformer, boolean declared)
    • processMetaAnnotations

      protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap, Annotation[] annotations, ClassTransformer classTransformer, boolean declared)
    • processMetaAnnotations

      protected void processMetaAnnotations(SetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap, Annotation annotation, ClassTransformer classTransformer, boolean declared)
    • getJavaClass

      public Class<T> getJavaClass()
      Description copied from interface: EnhancedAnnotated
      Gets the type of the element
      Specified by:
      getJavaClass in interface EnhancedAnnotated<T,S>
      Returns:
      The type of the element
    • getActualTypeArguments

      public Type[] getActualTypeArguments()
      Description copied from interface: EnhancedAnnotated
      Gets the actual type arguments for any parameterized types that this AnnotatedItem represents.
      Specified by:
      getActualTypeArguments in interface EnhancedAnnotated<T,S>
      Returns:
      An array of type arguments
    • getInterfaceClosure

      public Set<Type> getInterfaceClosure()
      Description copied from interface: EnhancedAnnotated
      Get the type hierarchy of any interfaces implemented by this class.

      The returned types should have any type parameters resolved to their actual types.

      There is no guarantee this methods executes in O(1) time

      Specified by:
      getInterfaceClosure in interface EnhancedAnnotated<T,S>
      Returns:
      the type hierarchy
    • getDelegate

      public abstract S getDelegate()
    • isParameterizedType

      public boolean isParameterizedType()
      Specified by:
      isParameterizedType in interface EnhancedAnnotated<T,S>
    • isPrimitive

      public boolean isPrimitive()
      Specified by:
      isPrimitive in interface EnhancedAnnotated<T,S>
    • getBaseType

      public Type getBaseType()
      Specified by:
      getBaseType in interface jakarta.enterprise.inject.spi.Annotated
    • getTypeClosure

      public Set<Type> getTypeClosure()
      Specified by:
      getTypeClosure in interface jakarta.enterprise.inject.spi.Annotated
    • getAnnotations

      public Set<Annotation> getAnnotations()
      Specified by:
      getAnnotations in interface jakarta.enterprise.inject.spi.Annotated
    • getMetaAnnotations

      public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
      Description copied from interface: EnhancedAnnotated
      Gets all annotations which are annotated with the given meta annotation type
      Specified by:
      getMetaAnnotations in interface EnhancedAnnotated<T,S>
      Returns:
      A set of matching meta-annotations. Returns an empty set if there are no matches.
    • getQualifiers

      public Set<Annotation> getQualifiers()
      Description copied from interface: EnhancedAnnotated
      Gets the binding types for this element

      This reflection type should not know about CDI qualifiers. However, it is very convenient, so we keep it here.

      Specified by:
      getQualifiers in interface EnhancedAnnotated<T,S>
    • getAnnotation

      public <A extends Annotation> A getAnnotation(Class<A> annotationType)
      Specified by:
      getAnnotation in interface jakarta.enterprise.inject.spi.Annotated
    • isAnnotationPresent

      public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
      Specified by:
      isAnnotationPresent in interface jakarta.enterprise.inject.spi.Annotated