Class AnnotatedElementFactory


  • public final class AnnotatedElementFactory
    extends Object
    Factory for Annotated elements.
    Version:
    $Rev$ $Date$
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear caches.
      <X> jakarta.enterprise.inject.spi.AnnotatedType<X> getAnnotatedType​(Class<X> annotatedClass)
      Get an already registered AnnotatedType.
      <X> Iterable<jakarta.enterprise.inject.spi.AnnotatedType<X>> getAnnotatedTypes​(Class<X> annotatedClass)
      Get all already registered AnnotatedTypes of the specified type.
      <T> Set<jakarta.enterprise.inject.spi.AnnotatedMethod<? super T>> getFilteredAnnotatedMethods​(jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType)
      Returns the AnnotatedMethods of the specified AnnotatedType, filtering out the overridden methods.
      <X> jakarta.enterprise.inject.spi.AnnotatedConstructor<X> newAnnotatedConstructor​(Constructor<X> constructor, jakarta.enterprise.inject.spi.AnnotatedType<X> declaringClass)
      Creates and configures new annotated constructor.
      <X> jakarta.enterprise.inject.spi.AnnotatedField<X> newAnnotatedField​(Field field, jakarta.enterprise.inject.spi.AnnotatedType<X> declaringClass)
      Creates and configures new annotated field.
      <X> jakarta.enterprise.inject.spi.AnnotatedMethod<X> newAnnotatedMethod​(Method method, jakarta.enterprise.inject.spi.AnnotatedType<X> declaringType)
      Creates and configures new annotated method.
      <X> jakarta.enterprise.inject.spi.AnnotatedType<X> newAnnotatedType​(Class<X> annotatedClass)
      Creates and configures a new annotated type.
      <X> jakarta.enterprise.inject.spi.AnnotatedType<X> setAnnotatedType​(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType)
      This method will get used to manually add AnnoatedTypes to our storage.
      <X> jakarta.enterprise.inject.spi.AnnotatedType<X> setAnnotatedType​(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType, String id)  
    • Constructor Detail

      • AnnotatedElementFactory

        public AnnotatedElementFactory​(WebBeansContext webBeansContext)
        No instantiate.
    • Method Detail

      • getAnnotatedType

        public <X> jakarta.enterprise.inject.spi.AnnotatedType<X> getAnnotatedType​(Class<X> annotatedClass)
        Get an already registered AnnotatedType. This will NOT create a new one! The returned AnnotatedType will reflect all the changes made during the boot process so far. If there was no AnnotatedType created yet for the given Class, null will be returned.
      • getAnnotatedTypes

        public <X> Iterable<jakarta.enterprise.inject.spi.AnnotatedType<X>> getAnnotatedTypes​(Class<X> annotatedClass)
        Get all already registered AnnotatedTypes of the specified type. This will NOT create a new one!
        Type Parameters:
        X -
        Parameters:
        annotatedClass -
        Returns:
        AnnotatedType
      • setAnnotatedType

        public <X> jakarta.enterprise.inject.spi.AnnotatedType<X> setAnnotatedType​(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType)
        This method will get used to manually add AnnoatedTypes to our storage. Those AnnotatedTypes are coming from Extensions and get registered e.g. via jakarta.enterprise.inject.spi.BeforeBeanDiscovery#addAnnotatedType(AnnotatedType) Sets the annotatedType and replace the given one.
        Type Parameters:
        X -
        Parameters:
        annotatedType -
        Returns:
        the previously registered AnnotatedType or null if not previously defined.
      • setAnnotatedType

        public <X> jakarta.enterprise.inject.spi.AnnotatedType<X> setAnnotatedType​(jakarta.enterprise.inject.spi.AnnotatedType<X> annotatedType,
                                                                                   String id)
      • newAnnotatedType

        public <X> jakarta.enterprise.inject.spi.AnnotatedType<X> newAnnotatedType​(Class<X> annotatedClass)
        Creates and configures a new annotated type. This always returns the fresh AnnotatedTypes without any modifications applied by Extensions!. To get any AnnotatedTypes which are modified during the boot process you shall use getAnnotatedType(Class).
        Type Parameters:
        X - class info
        Parameters:
        annotatedClass - annotated class
        Returns:
        new annotated type
      • newAnnotatedConstructor

        public <X> jakarta.enterprise.inject.spi.AnnotatedConstructor<X> newAnnotatedConstructor​(Constructor<X> constructor,
                                                                                                 jakarta.enterprise.inject.spi.AnnotatedType<X> declaringClass)
        Creates and configures new annotated constructor.
        Type Parameters:
        X - declaring class
        Parameters:
        constructor - constructor
        Returns:
        new annotated constructor
      • newAnnotatedField

        public <X> jakarta.enterprise.inject.spi.AnnotatedField<X> newAnnotatedField​(Field field,
                                                                                     jakarta.enterprise.inject.spi.AnnotatedType<X> declaringClass)
        Creates and configures new annotated field.
        Type Parameters:
        X - declaring class
        Parameters:
        field - field instance
        declaringClass - declaring class
        Returns:
        new annotated field
      • newAnnotatedMethod

        public <X> jakarta.enterprise.inject.spi.AnnotatedMethod<X> newAnnotatedMethod​(Method method,
                                                                                       jakarta.enterprise.inject.spi.AnnotatedType<X> declaringType)
        Creates and configures new annotated method.
        Type Parameters:
        X - declaring class
        Parameters:
        method - annotated method
        declaringType - declaring class info
        Returns:
        new annotated method
      • getFilteredAnnotatedMethods

        public <T> Set<jakarta.enterprise.inject.spi.AnnotatedMethod<? super T>> getFilteredAnnotatedMethods​(jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType)
        Returns the AnnotatedMethods of the specified AnnotatedType, filtering out the overridden methods.
      • clear

        public void clear()
        Clear caches.