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
Modifier and TypeMethodDescription<U> EnhancedAnnotatedType<? extends U>asEnhancedSubclass(EnhancedAnnotatedType<U> clazz) <S> SGet the constructor which matches the argument list provided<F> EnhancedAnnotatedField<F,?> getDeclaredEnhancedField(String fieldName) Get a field by nameCollection<EnhancedAnnotatedField<?,? super T>> 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>> 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 annotationTypegetDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType) Gets all annotations which are declared on this annotated item with the given meta annotation typeGets all constructorsgetEnhancedConstructors(Class<? extends Annotation> annotationType) Gets all constructors which are annotated with annotationTypeCollection<EnhancedAnnotatedField<?,? super T>> Gets all fields on the typegetEnhancedFields(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>> 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>Gets the superclass.Gets the no-args constructorbooleanbooleanbooleanbooleanisEnum()booleanisEquivalent(Class<?> clazz) Check if this is equivalent to a java classbooleanbooleanbooleanbooleanisSealed()Indicates if thisEnhancedAnnotatedTyperepresents a sealed class/interfacebooleanslim()Returns a lightweight implementation ofAnnotatedTypewith minimal memory footprint.Methods inherited from interface jakarta.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresentMethods inherited from interface jakarta.enterprise.inject.spi.AnnotatedType
getAnnotations, getConstructors, getFields, getJavaClass, getMethodsMethods 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 Details
-
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
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
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
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
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:
isParameterizedTypein interfaceEnhancedAnnotated<T,Class<T>>
-
isAbstract
boolean isAbstract() -
isEnum
boolean isEnum() -
isMemberClass
boolean isMemberClass() -
isLocalClass
boolean isLocalClass() -
isAnonymousClass
boolean isAnonymousClass() -
isSealed
boolean isSealed()Indicates if thisEnhancedAnnotatedTyperepresents a sealed class/interface- Returns:
- True if sealed, false otherwise
-
isSerializable
boolean isSerializable() -
isDiscovered
boolean isDiscovered() -
cast
-
asEnhancedSubclass
-
isEquivalent
Check if this is equivalent to a java class- Parameters:
clazz- The Java class- Returns:
- true if equivalent
-
getSimpleName
String getSimpleName() -
getDeclaredMetaAnnotations
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 ofAnnotatedTypewith minimal memory footprint.- Specified by:
slimin interfaceEnhancedAnnotated<T,Class<T>> - Returns:
- the slim version of this
AnnotatedType
-