Package org.apache.webbeans.portable
Class AnnotatedElementFactory
- java.lang.Object
-
- org.apache.webbeans.portable.AnnotatedElementFactory
-
public final class AnnotatedElementFactory extends Object
Factory forAnnotatedelements.- Version:
- $Rev$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static StringOWB_DEFAULT_KEY
-
Constructor Summary
Constructors Constructor Description AnnotatedElementFactory(WebBeansContext webBeansContext)No instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()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 theAnnotatedMethods of the specifiedAnnotatedType, 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)
-
-
-
Field Detail
-
OWB_DEFAULT_KEY
public static final String OWB_DEFAULT_KEY
- See Also:
- Constant Field Values
-
-
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,nullwill 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. viajakarta.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 usegetAnnotatedType(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 instancedeclaringClass- 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 methoddeclaringType- 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 theAnnotatedMethods of the specifiedAnnotatedType, filtering out the overridden methods.
-
clear
public void clear()
Clear caches.
-
-