Class AnnotationDescription.AnnotationInvocationHandler<T extends java.lang.annotation.Annotation>

  • Type Parameters:
    T - The type of the handled annotation.
    All Implemented Interfaces:
    java.lang.reflect.InvocationHandler
    Enclosing interface:
    AnnotationDescription

    public static class AnnotationDescription.AnnotationInvocationHandler<T extends java.lang.annotation.Annotation>
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    An InvocationHandler for implementing annotations.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AnnotationInvocationHandler​(java.lang.Class<T> annotationType, java.util.LinkedHashMap<java.lang.reflect.Method,​AnnotationValue.Loaded<?>> values)
      Creates a new invocation handler.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      int hashCode()  
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] argument)  
      static <S extends java.lang.annotation.Annotation>
      S
      of​(java.lang.ClassLoader classLoader, java.lang.Class<S> annotationType, java.util.Map<java.lang.String,​? extends AnnotationValue<?,​?>> values)
      Creates a proxy instance for the supplied annotation type and values.
      protected java.lang.String toStringRepresentation()
      Returns the string representation of the represented annotation.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnnotationInvocationHandler

        protected AnnotationInvocationHandler​(java.lang.Class<T> annotationType,
                                              java.util.LinkedHashMap<java.lang.reflect.Method,​AnnotationValue.Loaded<?>> values)
        Creates a new invocation handler.
        Parameters:
        annotationType - The loaded annotation type.
        values - A sorted list of values of this annotation.
    • Method Detail

      • of

        public static <S extends java.lang.annotation.Annotation> S of​(java.lang.ClassLoader classLoader,
                                                                       java.lang.Class<S> annotationType,
                                                                       java.util.Map<java.lang.String,​? extends AnnotationValue<?,​?>> values)
                                                                throws java.lang.ClassNotFoundException
        Creates a proxy instance for the supplied annotation type and values.
        Type Parameters:
        S - The type of the handled annotation.
        Parameters:
        classLoader - The class loader that should be used for loading the annotation's values.
        annotationType - The annotation's type.
        values - The values that the annotation contains.
        Returns:
        A proxy for the annotation type and values.
        Throws:
        java.lang.ClassNotFoundException - If the class of an instance that is contained by this annotation could not be found.
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] argument)
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
      • toStringRepresentation

        protected java.lang.String toStringRepresentation()
        Returns the string representation of the represented annotation.
        Returns:
        The string representation of the represented annotation.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object