Interface EnhancedAnnotatedType<T>
-
- All Superinterfaces:
jakarta.enterprise.inject.spi.Annotated
,jakarta.enterprise.inject.spi.AnnotatedType<T>
,EnhancedAnnotated<T,Class<T>>
- All Known Subinterfaces:
EnhancedAnnotation<T>
- All Known Implementing Classes:
EnhancedAnnotatedTypeImpl
,EnhancedAnnotationImpl
public interface EnhancedAnnotatedType<T> extends EnhancedAnnotated<T,Class<T>>, jakarta.enterprise.inject.spi.AnnotatedType<T>
Represents a Class- Author:
- Pete Muir
-
-
Field Summary
-
Fields inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotated
MAPPED_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <U> EnhancedAnnotatedType<? extends U>
asEnhancedSubclass(EnhancedAnnotatedType<U> clazz)
<S> S
cast(Object object)
EnhancedAnnotatedConstructor<T>
getDeclaredEnhancedConstructor(ConstructorSignature signature)
Get the constructor which matches the argument list provided<F> EnhancedAnnotatedField<F,?>
getDeclaredEnhancedField(String fieldName)
Get a field by nameCollection<EnhancedAnnotatedField<?,? super T>>
getDeclaredEnhancedFields()
Gets all fields declared on this class only.Collection<EnhancedAnnotatedField<?,? super T>>
getDeclaredEnhancedFields(Class<? extends Annotation> annotationType)
Gets all fields which are annotated with the given annotation type on this class only.<M> EnhancedAnnotatedMethod<M,?>
getDeclaredEnhancedMethod(MethodSignature signature)
Get a method by nameCollection<EnhancedAnnotatedMethod<?,? super T>>
getDeclaredEnhancedMethods()
Gets all methods on the typeCollection<EnhancedAnnotatedMethod<?,? super T>>
getDeclaredEnhancedMethods(Class<? extends Annotation> annotationType)
Gets all methods annotated with annotationTypeCollection<EnhancedAnnotatedMethod<?,? super T>>
getDeclaredEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
Gets declared with parameters annotated with annotationTypeCollection<Annotation>
getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
Gets all annotations which are declared on this annotated item with the given meta annotation typeCollection<EnhancedAnnotatedConstructor<T>>
getEnhancedConstructors()
Gets all constructorsCollection<EnhancedAnnotatedConstructor<T>>
getEnhancedConstructors(Class<? extends Annotation> annotationType)
Gets all constructors which are annotated with annotationTypeCollection<EnhancedAnnotatedField<?,? super T>>
getEnhancedFields()
Gets all fields on the typeCollection<EnhancedAnnotatedField<?,?>>
getEnhancedFields(Class<? extends Annotation> annotationType)
Gets all fields which are annotated with the given annotation type on this class and all super classes<M> EnhancedAnnotatedMethod<M,?>
getEnhancedMethod(MethodSignature signature)
Get a method by nameCollection<EnhancedAnnotatedMethod<?,? super T>>
getEnhancedMethods()
Gets all methods on the type including those declared on a superclass ofEnhancedAnnotated.getJavaClass()
.Collection<EnhancedAnnotatedMethod<?,? super T>>
getEnhancedMethods(Class<? extends Annotation> annotationType)
Gets all methods annotated with annotationType including those declared on a superclass ofEnhancedAnnotated.getJavaClass()
.Collection<EnhancedAnnotatedMethod<?,? super T>>
getEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
Gets all methods with parameters annotated with annotationType including those declared on a superclass ofEnhancedAnnotated.getJavaClass()
.EnhancedAnnotatedType<? super T>
getEnhancedSuperclass()
Gets the superclass.EnhancedAnnotatedConstructor<T>
getNoArgsEnhancedConstructor()
Gets the no-args constructorString
getSimpleName()
boolean
isAbstract()
boolean
isAnonymousClass()
boolean
isDiscovered()
boolean
isEnum()
boolean
isEquivalent(Class<?> clazz)
Check if this is equivalent to a java classboolean
isLocalClass()
boolean
isMemberClass()
boolean
isParameterizedType()
boolean
isSerializable()
SlimAnnotatedType<T>
slim()
Returns a lightweight implementation ofAnnotatedType
with minimal memory footprint.-
Methods inherited from interface jakarta.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresent
-
Methods inherited from interface jakarta.enterprise.inject.spi.AnnotatedType
getAnnotations, getConstructors, getFields, getJavaClass, getMethods
-
Methods inherited from interface org.jboss.weld.annotated.enhanced.EnhancedAnnotated
getActualTypeArguments, getBindingsAsArray, getInterfaceClosure, getJavaClass, getMetaAnnotations, getName, getPackage, getQualifiers, isFinal, isGeneric, isPackagePrivate, isPrimitive, isPrivate, isPublic, isStatic
-
-
-
-
Method Detail
-
getEnhancedFields
Collection<EnhancedAnnotatedField<?,? super T>> getEnhancedFields()
Gets all fields on the type- Returns:
- A set of abstracted fields
-
getEnhancedMethods
Collection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethods()
Gets all methods on the type including those declared on a superclass ofEnhancedAnnotated.getJavaClass()
. Overridden methods are not returned.- Returns:
- A set of abstracted methods
-
getDeclaredEnhancedMethods
Collection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethods()
Gets all methods on the type- Returns:
- A set of abstracted methods
-
getDeclaredEnhancedField
<F> EnhancedAnnotatedField<F,?> getDeclaredEnhancedField(String fieldName)
Get a field by name- Type Parameters:
F
- the expected type of the field- Parameters:
fieldName
- the field name- Returns:
- the field
-
getEnhancedFields
Collection<EnhancedAnnotatedField<?,?>> getEnhancedFields(Class<? extends Annotation> annotationType)
Gets all fields which are annotated with the given annotation type on this class and all super classes- Parameters:
annotationType
- The annotation to match- Returns:
- A set of abstracted fields with the given annotation. Returns an empty set if there are no matches
-
getDeclaredEnhancedFields
Collection<EnhancedAnnotatedField<?,? super T>> getDeclaredEnhancedFields()
Gets all fields declared on this class only.- Returns:
- A set of abstracted fields. Returns an empty set if there are no matches
-
getDeclaredEnhancedFields
Collection<EnhancedAnnotatedField<?,? super T>> getDeclaredEnhancedFields(Class<? extends Annotation> annotationType)
Gets all fields which are annotated with the given annotation type on this class only.- Parameters:
annotationType
- The annotation to match- Returns:
- A set of abstracted fields with the given annotation. Returns an empty set if there are no matches
-
getEnhancedConstructors
Collection<EnhancedAnnotatedConstructor<T>> getEnhancedConstructors()
Gets all constructors
-
getEnhancedConstructors
Collection<EnhancedAnnotatedConstructor<T>> getEnhancedConstructors(Class<? extends Annotation> annotationType)
Gets all constructors which are annotated with annotationType- Parameters:
annotationType
- The annotation type to match- Returns:
- A set of abstracted fields with the given annotation. Returns an empty set if there are no matches
-
getNoArgsEnhancedConstructor
EnhancedAnnotatedConstructor<T> getNoArgsEnhancedConstructor()
Gets the no-args constructor- Returns:
- The no-args constructor, or null if not defined
-
getDeclaredEnhancedConstructor
EnhancedAnnotatedConstructor<T> getDeclaredEnhancedConstructor(ConstructorSignature signature)
Get the constructor which matches the argument list provided- Parameters:
parameterTypes
- the parameters of the constructor- Returns:
- the matching constructor, or null if not defined
-
getEnhancedMethods
Collection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethods(Class<? extends Annotation> annotationType)
Gets all methods annotated with annotationType including those declared on a superclass ofEnhancedAnnotated.getJavaClass()
. Overridden methods are not returned.- Parameters:
annotationType
- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
getDeclaredEnhancedMethods
Collection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethods(Class<? extends Annotation> annotationType)
Gets all methods annotated with annotationType- Parameters:
annotationType
- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
getDeclaredEnhancedMethod
<M> EnhancedAnnotatedMethod<M,?> getDeclaredEnhancedMethod(MethodSignature signature)
Get a method by name- Type Parameters:
M
- the expected return type- Parameters:
signature
- the name of the method- Returns:
- the method, or null if it doesn't exist
-
getEnhancedMethod
<M> EnhancedAnnotatedMethod<M,?> getEnhancedMethod(MethodSignature signature)
Get a method by name- Type Parameters:
M
- the expected return type- Parameters:
signature
- the name of the method- Returns:
- the method, or null if it doesn't exist
-
getDeclaredEnhancedMethodsWithAnnotatedParameters
Collection<EnhancedAnnotatedMethod<?,? super T>> getDeclaredEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
Gets declared with parameters annotated with annotationType- Parameters:
annotationType
- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
getEnhancedMethodsWithAnnotatedParameters
Collection<EnhancedAnnotatedMethod<?,? super T>> getEnhancedMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
Gets all methods with parameters annotated with annotationType including those declared on a superclass ofEnhancedAnnotated.getJavaClass()
. Overridden methods are not returned.- Parameters:
annotationType
- The annotation to match- Returns:
- A set of abstracted methods with the given annotation. Returns an empty set if there are no matches
-
getEnhancedSuperclass
EnhancedAnnotatedType<? super T> getEnhancedSuperclass()
Gets the superclass.- Returns:
- The abstracted superclass, null if there is no superclass
-
isParameterizedType
boolean isParameterizedType()
- Specified by:
isParameterizedType
in interfaceEnhancedAnnotated<T,Class<T>>
-
isAbstract
boolean isAbstract()
-
isEnum
boolean isEnum()
-
isMemberClass
boolean isMemberClass()
-
isLocalClass
boolean isLocalClass()
-
isAnonymousClass
boolean isAnonymousClass()
-
isSerializable
boolean isSerializable()
-
isDiscovered
boolean isDiscovered()
-
cast
<S> S cast(Object object)
-
asEnhancedSubclass
<U> EnhancedAnnotatedType<? extends U> asEnhancedSubclass(EnhancedAnnotatedType<U> clazz)
-
isEquivalent
boolean isEquivalent(Class<?> clazz)
Check if this is equivalent to a java class- Parameters:
clazz
- The Java class- Returns:
- true if equivalent
-
getSimpleName
String getSimpleName()
-
getDeclaredMetaAnnotations
Collection<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
Gets all annotations which are declared on this annotated item with the given meta annotation type- Parameters:
The
- meta annotation to match- Returns:
- A set of matching meta-annotations. Returns an empty set if there are no matches.
-
slim
SlimAnnotatedType<T> slim()
Returns a lightweight implementation ofAnnotatedType
with minimal memory footprint.- Specified by:
slim
in interfaceEnhancedAnnotated<T,Class<T>>
- Returns:
- the slim version of this
AnnotatedType
-
-