Class AnnotationDescription.ForLoadedAnnotation<S extends Annotation>

    • Constructor Detail

      • ForLoadedAnnotation

        protected ForLoadedAnnotation​(S annotation)
        Creates a new annotation description for a loaded annotation.
        Parameters:
        annotation - The annotation to represent.
    • Method Detail

      • of

        public static <U extends AnnotationAnnotationDescription.Loadable<U> of​(U annotation)
        Creates a description of the given annotation.
        Type Parameters:
        U - The type of the annotation.
        Parameters:
        annotation - The annotation to be described.
        Returns:
        A description of the given annotation.
      • load

        public S load()
        Loads this annotation description. This causes all classes referenced by the annotation value to be loaded. Without specifying a class loader, the annotation's class loader which was used to prepare this instance is used.
        Specified by:
        load in interface AnnotationDescription.Loadable<S extends Annotation>
        Returns:
        A loaded version of this annotation description.
      • asValue

        public static AnnotationValue<?,​?> asValue​(Object value,
                                                         Class<?> type)
        Transforms an annotation property to an annotation value.
        Parameters:
        type - The annotation's type.
        value - The annotations value.
        Returns:
        An annotation value representation.
      • prepare

        public <T extends AnnotationAnnotationDescription.Loadable<T> prepare​(Class<T> annotationType)
        Links this annotation description to a given annotation type such that it can be loaded. This does not cause the values of this annotation to be loaded.
        Specified by:
        prepare in interface AnnotationDescription
        Type Parameters:
        T - The type of the annotation.
        Parameters:
        annotationType - The loaded annotation type of this annotation description.
        Returns:
        A loadable version of this annotation description.