net.sourceforge.retroweaver.runtime.java.lang.annotation
Class AnnotationImpl

java.lang.Object
  extended by net.sourceforge.retroweaver.runtime.java.lang.annotation.AnnotationImpl
All Implemented Interfaces:
java.lang.reflect.InvocationHandler, Annotation

public class AnnotationImpl
extends java.lang.Object
implements java.lang.reflect.InvocationHandler, Annotation

The implementation of the Annotation interface, which gets returned from various points in java.lang.Class and java.lang.reflect.* classes.

Author:
Toby Reyelts Date: Feb 20, 2005 Time: 11:37:18 PM

Method Summary
 java.lang.Class<? extends Annotation> annotationType()
          Returns the annotation type of this annotation.
static Annotation createAnnotation(java.lang.Class<? extends Annotation> annotationType, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Called from generated bytecode to instantiate a new Annotation.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object represents an annotation that is logically equivalent to this one.
 int hashCode()
          Returns the hash code of this annotation, as defined below:
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 java.lang.String toString()
          Returns a string representation of this annotation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createAnnotation

public static Annotation createAnnotation(java.lang.Class<? extends Annotation> annotationType,
                                          java.util.Map<java.lang.String,java.lang.Object> attributes)
Called from generated bytecode to instantiate a new Annotation. Specifically, a new dynamic proxy is created with a type annotationType, and this class as the InvocationHandler.

Parameters:
annotationType - - The Annotation class that this AnnotationImpl should represent
attributes - - The attributes for the Annotation For example, for @Persistable, Persistable.class

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 Annotation> annotationType()
Description copied from interface: Annotation
Returns the annotation type of this annotation.

Specified by:
annotationType in interface Annotation

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: Annotation
Returns true if the specified object represents an annotation that is logically equivalent to this one.

Specified by:
equals in interface Annotation
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Description copied from interface: Annotation
Returns the hash code of this annotation, as defined below:

Specified by:
hashCode in interface Annotation
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Description copied from interface: Annotation
Returns a string representation of this annotation.

Specified by:
toString in interface Annotation
Overrides:
toString in class java.lang.Object