aicas logo Jamaica 3.4 release 8

sun.reflect.annotation
Class AnnotationInvocationHandler

java.lang.Object
  extended by sun.reflect.annotation.AnnotationInvocationHandler
All Implemented Interfaces:
Serializable, InvocationHandler

public final class AnnotationInvocationHandler
extends Object
implements InvocationHandler, Serializable

This class exists for serialization compatibility with the JDK. VMs can choose to implement annotations by constructing proxies with this invocation handler, but that is not required. If a different strategy for proxy objects is chosen, they can have a writeReplace method to substitute a Proxy based on this invocation handler is used for serialization.

See Also:
Serialized Form

Constructor Summary
AnnotationInvocationHandler(Class type, Map memberValues)
          Construct a new invocation handler for an annotation proxy.
 
Method Summary
static boolean equals(Class type, Map memberValues, Object other)
          Compare an instance of AnnotationInvocationHandler with another object.
static int hashCode(Class type, Map memberValues)
          Compute the hashCode for an annotation.
 Object invoke(Object proxy, Method method, Object[] args)
           Handles method calls on a dynamically created Proxy.
static String toString(Class type, Map memberValues)
          This method is public for use by other parts of the VM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationInvocationHandler

public AnnotationInvocationHandler(Class type,
                                   Map memberValues)
Construct a new invocation handler for an annotation proxy. Note that the VM is responsible for filling the memberValues map with the default values of all the annotation members.

Method Detail

equals

public static boolean equals(Class type,
                             Map memberValues,
                             Object other)
Compare an instance of AnnotationInvocationHandler with another object. Note that the other object does not have to be an AnnotationInvocationHandler, any implementation of the annotation interface is allowed to be compared for equality. Note that this makes the equals method asymmetric, but this behavior is specified by Annotation.equals and identical to the JDK. This method is public for use by other parts of the VM. Some VMs (can) use different representations of annotations that reuse this method.


hashCode

public static int hashCode(Class type,
                           Map memberValues)
Compute the hashCode for an annotation. Note that the algorithm is specified by Annotation.hashCode. This method is public for use by other parts of the VM. Some VMs (can) use different representations of annotations that reuse this method.


toString

public static String toString(Class type,
                              Map memberValues)
This method is public for use by other parts of the VM. Some VMs (can) use different representations of annotations that reuse this method.


invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Description copied from interface: InvocationHandler
 Handles method calls on a dynamically created Proxy.
 

Specified by:
invoke in interface InvocationHandler
Parameters:
proxy - the proxy object on which the methode was invoked
method - the method that was invoked
args - the arguments that were given to the method
Returns:
the return value from the invoked method, boxed in case the return value is a primitive type.
Throws:
Throwable - that is listed in the throws clause of the invoked method or UndeclaredThrowableException in case the thrown exception is not listed there.

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.