Class BackedAnnotatedType<X>
- java.lang.Object
-
- org.jboss.weld.annotated.slim.BaseAnnotated
-
- org.jboss.weld.annotated.slim.backed.BackedAnnotated
-
- org.jboss.weld.annotated.slim.backed.BackedAnnotatedType<X>
-
- All Implemented Interfaces:
Annotated
,AnnotatedType<X>
,Serializable
,Identified<AnnotatedTypeIdentifier>
,SlimAnnotatedType<X>
public class BackedAnnotatedType<X> extends BackedAnnotated implements SlimAnnotatedType<X>, Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.weld.annotated.slim.SlimAnnotatedType
SlimAnnotatedType.SerializationProxy<X>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear up cached content to save memory.boolean
equals(Object obj)
protected AnnotatedElement
getAnnotatedElement()
<T extends Annotation>
TgetAnnotation(Class<T> annotationType)
Get program element annotation of a certain annotation type.Set<Annotation>
getAnnotations()
Get all annotations of the program element.Set<AnnotatedConstructor<X>>
getConstructors()
Get the constructors of the type.Set<AnnotatedField<? super X>>
getFields()
Get the fields of the type.AnnotatedTypeIdentifier
getIdentifier()
Class<X>
getJavaClass()
Get the underlyingClass
.Set<AnnotatedMethod<? super X>>
getMethods()
Get the methods of the type.ReflectionCache
getReflectionCache()
int
hashCode()
protected LazyValueHolder<Set<Type>>
initTypeClosure(Type baseType, SharedObjectCache cache)
boolean
isAnnotationPresent(Class<? extends Annotation> annotationType)
Determine if the program element has an annotation of a certain annotation type.static <X> BackedAnnotatedType<X>
of(Class<X> javaClass, Type baseType, SharedObjectCache sharedObjectCache, ReflectionCache reflectionCache, String contextId, String bdaId)
static <X> BackedAnnotatedType<X>
of(Class<X> javaClass, Type baseType, SharedObjectCache sharedObjectCache, ReflectionCache reflectionCache, String contextId, String bdaId, String suffix)
static <X> BackedAnnotatedType<X>
of(Class<X> javaClass, SharedObjectCache sharedObjectCache, ReflectionCache reflectionCache, String contextId, String bdaId)
String
toString()
-
Methods inherited from class org.jboss.weld.annotated.slim.backed.BackedAnnotated
getTypeClosure
-
Methods inherited from class org.jboss.weld.annotated.slim.BaseAnnotated
getBaseType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jakarta.enterprise.inject.spi.Annotated
getBaseType, getTypeClosure
-
Methods inherited from interface jakarta.enterprise.inject.spi.AnnotatedType
getAnnotations
-
-
-
-
Method Detail
-
of
public static <X> BackedAnnotatedType<X> of(Class<X> javaClass, SharedObjectCache sharedObjectCache, ReflectionCache reflectionCache, String contextId, String bdaId)
-
of
public static <X> BackedAnnotatedType<X> of(Class<X> javaClass, Type baseType, SharedObjectCache sharedObjectCache, ReflectionCache reflectionCache, String contextId, String bdaId)
-
of
public static <X> BackedAnnotatedType<X> of(Class<X> javaClass, Type baseType, SharedObjectCache sharedObjectCache, ReflectionCache reflectionCache, String contextId, String bdaId, String suffix)
-
initTypeClosure
protected LazyValueHolder<Set<Type>> initTypeClosure(Type baseType, SharedObjectCache cache)
- Overrides:
initTypeClosure
in classBackedAnnotated
-
getAnnotatedElement
protected AnnotatedElement getAnnotatedElement()
- Specified by:
getAnnotatedElement
in classBackedAnnotated
-
getJavaClass
public Class<X> getJavaClass()
Description copied from interface:AnnotatedType
Get the underlying
Class
.- Specified by:
getJavaClass
in interfaceAnnotatedType<X>
- Returns:
- the
Class
-
getConstructors
public Set<AnnotatedConstructor<X>> getConstructors()
Description copied from interface:AnnotatedType
Get the constructors of the type. If an empty set is returned, a default constructor with no parameters will be assumed.
- Specified by:
getConstructors
in interfaceAnnotatedType<X>
- Returns:
- the constructors, or an empty set if none are defined
-
getMethods
public Set<AnnotatedMethod<? super X>> getMethods()
Description copied from interface:AnnotatedType
Get the methods of the type.
- Specified by:
getMethods
in interfaceAnnotatedType<X>
- Returns:
- the methods, or an empty set if none are defined
-
getFields
public Set<AnnotatedField<? super X>> getFields()
Description copied from interface:AnnotatedType
Get the fields of the type.
- Specified by:
getFields
in interfaceAnnotatedType<X>
- Returns:
- the fields, or an empty set if none are defined
-
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
Description copied from interface:Annotated
Get program element annotation of a certain annotation type. The behavior of this method is intended to be the same behavior as
AnnotatedElement.getAnnotation(Class)
, where repeatable annotations are not supported.- Specified by:
getAnnotation
in interfaceAnnotated
- Type Parameters:
T
- the type of the annotation- Parameters:
annotationType
- the class of the annotation type- Returns:
- the first program element annotation of the given annotation type, or a null value
-
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Description copied from interface:Annotated
Determine if the program element has an annotation of a certain annotation type. The behavior of this method is similar to
AnnotatedElement.isAnnotationPresent(Class)
for the underlying program element.- Specified by:
isAnnotationPresent
in interfaceAnnotated
- Parameters:
annotationType
- the annotation type to check for- Returns:
true
if the program element has an annotation of the given annotation type, orfalse
otherwise
-
getAnnotations
public Set<Annotation> getAnnotations()
Description copied from interface:Annotated
Get all annotations of the program element.
- Specified by:
getAnnotations
in interfaceAnnotated
- Overrides:
getAnnotations
in classBackedAnnotated
- Returns:
- all annotations of the program element, or an empty set if no annotations are present
-
clear
public void clear()
Description copied from interface:SlimAnnotatedType
Clear up cached content to save memory. Called after bootstrap is complete.- Specified by:
clear
in interfaceSlimAnnotatedType<X>
-
getReflectionCache
public ReflectionCache getReflectionCache()
- Specified by:
getReflectionCache
in classBackedAnnotated
-
getIdentifier
public AnnotatedTypeIdentifier getIdentifier()
- Specified by:
getIdentifier
in interfaceIdentified<X>
-
-