Module jakarta.cdi

Interface AnnotatedType<X>

  • Type Parameters:
    X - the type
    All Superinterfaces:

    public interface AnnotatedType<X>
    extends Annotated

    Represents a Java class or interface.

    Gavin King, Pete Muir
    See Also:
    • Method Detail

      • getJavaClass

        java.lang.Class<X> getJavaClass()

        Get the underlying Class.

        the Class
      • getConstructors

        java.util.Set<AnnotatedConstructor<X>> getConstructors()

        Get the constructors of the type. If an empty set is returned, a default constructor with no parameters will be assumed.

        the constructors, or an empty set if none are defined
      • getMethods

        java.util.Set<AnnotatedMethod<? super X>> getMethods()

        Get the methods of the type.

        the methods, or an empty set if none are defined
      • getFields

        java.util.Set<AnnotatedField<? super X>> getFields()

        Get the fields of the type.

        the fields, or an empty set if none are defined
      • getAnnotations

        default <T extends java.lang.annotation.Annotation> java.util.Set<T> getAnnotations​(java.lang.Class<T> annotationType)
        Description copied from interface: Annotated

        Get program element annotations of a certain annotation type.

        This method returns back all annotations, including repeatable annotations of this type. The behavior of this method is intended to be the same behavior as AnnotatedElement.getAnnotationsByType(Class), where repeatable annotations are supported.

        Specified by:
        getAnnotations in interface Annotated
        Type Parameters:
        T - the type of the annotation
        annotationType - the class of the annotation type
        the program element annotations of the given annotation type, or an empty collection