Package jnr.ffi.util

Class AnnotationProxy<A extends java.lang.annotation.Annotation>

  • Type Parameters:
    A - The annotation type has to be proxed.
    All Implemented Interfaces:
    java.lang.annotation.Annotation, java.lang.reflect.InvocationHandler

    public final class AnnotationProxy<A extends java.lang.annotation.Annotation>
    extends java.lang.Object
    implements java.lang.annotation.Annotation, java.lang.reflect.InvocationHandler
    Version:
    $Id$
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
      boolean equals​(java.lang.Object obj)
      java.lang.Object getProperty​(java.lang.String name)
      Returns the property value, given the name, if present.
      A getProxedAnnotation()
      Returns the proxed annotation.
      int hashCode()
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
      static <A extends java.lang.annotation.Annotation>
      AnnotationProxy<A>
      newProxy​(java.lang.Class<A> annotationType)
      Creates a new annotation proxy.
      void setProperty​(java.lang.String name, java.lang.Object value)
      Set a property value.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • newProxy

        public static <A extends java.lang.annotation.Annotation> AnnotationProxy<A> newProxy​(java.lang.Class<A> annotationType)
        Creates a new annotation proxy.
        Type Parameters:
        A - the annotation type has to be proxed.
        Parameters:
        annotationType - the annotation type class has to be proxed.
        Returns:
        a new annotation proxy.
      • setProperty

        public void setProperty​(java.lang.String name,
                                java.lang.Object value)
        Set a property value.
        Parameters:
        name - the property name.
        value - the property value.
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
        Returns the property value, given the name, if present.
        Parameters:
        name - the property name.
        Returns:
        the property value, given the name, if present.
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • annotationType

        public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
        Specified by:
        annotationType in interface java.lang.annotation.Annotation
      • getProxedAnnotation

        public A getProxedAnnotation()
        Returns the proxed annotation.
        Returns:
        the proxed annotation.
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.lang.annotation.Annotation
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.lang.annotation.Annotation
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.annotation.Annotation
        Overrides:
        toString in class java.lang.Object