Interface AnnotationMetadataProvider

    • Method Detail

      • synthesize

        default <T extends java.lang.annotation.Annotation> T synthesize​(java.lang.Class<T> annotationClass)
        Description copied from interface: AnnotationSource
        Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
        Specified by:
        synthesize in interface AnnotationSource
        Type Parameters:
        T - The annotation generic type
        Parameters:
        annotationClass - The annotation class
        Returns:
        The annotation or null if it doesn't exist
      • synthesizeAll

        default java.lang.annotation.Annotation[] synthesizeAll()
        Description copied from interface: AnnotationSource
        Synthesizes a new annotations from the metadata. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
        Specified by:
        synthesizeAll in interface AnnotationSource
        Returns:
        All the annotations
      • synthesizeDeclared

        default java.lang.annotation.Annotation[] synthesizeDeclared()
        Description copied from interface: AnnotationSource
        Synthesizes a new annotations from the metadata. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
        Specified by:
        synthesizeDeclared in interface AnnotationSource
        Returns:
        All declared annotations
      • isAnnotationPresent

        default boolean isAnnotationPresent​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
        Description copied from interface: AnnotationSource
        Return whether an annotation is present.
        Specified by:
        isAnnotationPresent in interface AnnotationSource
        Parameters:
        annotationClass - The annotation class
        Returns:
        True if it is
      • synthesizeDeclared

        default <T extends java.lang.annotation.Annotation> T synthesizeDeclared​(java.lang.Class<T> annotationClass)
        Description copied from interface: AnnotationSource
        Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.

        This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)

        Specified by:
        synthesizeDeclared in interface AnnotationSource
        Type Parameters:
        T - The annotation generic type
        Parameters:
        annotationClass - The annotation class
        Returns:
        The annotation or null if it doesn't exist
      • synthesizeAnnotationsByType

        default <T extends java.lang.annotation.Annotation> T[] synthesizeAnnotationsByType​(java.lang.Class<T> annotationClass)
        Description copied from interface: AnnotationSource
        Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
        Specified by:
        synthesizeAnnotationsByType in interface AnnotationSource
        Type Parameters:
        T - The annotation generic type
        Parameters:
        annotationClass - The annotation type
        Returns:
        All annotations by the given type
      • synthesizeDeclaredAnnotationsByType

        default <T extends java.lang.annotation.Annotation> T[] synthesizeDeclaredAnnotationsByType​(java.lang.Class<T> annotationClass)
        Description copied from interface: AnnotationSource
        Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.
        Specified by:
        synthesizeDeclaredAnnotationsByType in interface AnnotationSource
        Type Parameters:
        T - The annotation generic type
        Parameters:
        annotationClass - The annotation type
        Returns:
        Declared annotations by the given type
      • findAnnotation

        default <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findAnnotation​(java.lang.Class<T> annotationClass)
        Description copied from interface: AnnotationSource
        Find an AnnotationValue for the given annotation type.
        Specified by:
        findAnnotation in interface AnnotationSource
        Type Parameters:
        T - The annotation type
        Parameters:
        annotationClass - The annotation
        Returns:
        A AnnotationValue instance
      • findDeclaredAnnotation

        default <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findDeclaredAnnotation​(java.lang.String annotation)
        Description copied from interface: AnnotationSource
        Get all of the values for the given annotation that are directly declared on the annotated element.
        Specified by:
        findDeclaredAnnotation in interface AnnotationSource
        Type Parameters:
        T - The annotation type
        Parameters:
        annotation - The annotation name
        Returns:
        A AnnotationValue instance
      • findDeclaredAnnotation

        default <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findDeclaredAnnotation​(java.lang.Class<T> annotationClass)
        Description copied from interface: AnnotationSource
        Get all of the values for the given annotation that are directly declared on the annotated element.
        Specified by:
        findDeclaredAnnotation in interface AnnotationSource
        Type Parameters:
        T - The annotation type
        Parameters:
        annotationClass - The annotation name
        Returns:
        A AnnotationValue instance