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
  • 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 of EnhancedAnnotated.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 of EnhancedAnnotated.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 of EnhancedAnnotated.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 interface EnhancedAnnotated<T,Class<T>>
    • isAbstract

      boolean isAbstract()
    • isEnum

      boolean isEnum()
    • isMemberClass

      boolean isMemberClass()
    • isLocalClass

      boolean isLocalClass()
    • isAnonymousClass

      boolean isAnonymousClass()
    • isSealed

      boolean isSealed()
      Indicates if this EnhancedAnnotatedType represents a sealed class/interface
      Returns:
      True if sealed, false otherwise
    • 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

      Returns a lightweight implementation of AnnotatedType with minimal memory footprint.
      Specified by:
      slim in interface EnhancedAnnotated<T,Class<T>>
      Returns:
      the slim version of this AnnotatedType