Class AnnotationDescription.ForLoadedAnnotation<S extends java.lang.annotation.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 java.lang.annotation.Annotation> AnnotationDescription.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()
               throws java.lang.ClassNotFoundException
        Description copied from interface: AnnotationDescription.Loadable
        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.
        Returns:
        A loaded version of this annotation description.
        Throws:
        java.lang.ClassNotFoundException - If any linked classes of the annotation cannot be loaded.
      • asValue

        public static AnnotationValue<?,​?> asValue​(java.lang.Object value,
                                                         java.lang.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 java.lang.annotation.Annotation> AnnotationDescription.Loadable<T> prepare​(java.lang.Class<T> annotationType)
        Description copied from interface: AnnotationDescription
        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.
        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.
      • getAnnotationType

        public TypeDescription getAnnotationType()
        Description copied from interface: AnnotationDescription
        Returns a description of the annotation type of this annotation.
        Returns:
        A description of the annotation type of this annotation.