org.apache.webbeans.annotation
Class WebBeansAnnotation

java.lang.Object
  extended by org.apache.webbeans.annotation.WebBeansAnnotation
All Implemented Interfaces:
Annotation, javassist.util.proxy.MethodHandler

public class WebBeansAnnotation
extends Object
implements Annotation, javassist.util.proxy.MethodHandler

Defines the Annotation implementation. It is used for creating annotations from the XML configuration files.

Since:
1.0
Author:
Gurkan Erdogdu

Constructor Summary
WebBeansAnnotation(Class<? extends Annotation> annotationType)
          Creates new annotation type object from given annotation type
 
Method Summary
 Class<? extends Annotation> annotationType()
           
 boolean equals(Object other)
           
 Map<String,Object> getAnnotationMembersValueMap()
          Gets
 int hashCode()
           
 Object invoke(Object self, Method m, Method proceed, Object[] args)
          Javassist proxy object method handler.
 void setMemberValue(String memberName, Object memberValue)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebBeansAnnotation

public WebBeansAnnotation(Class<? extends Annotation> annotationType)
Creates new annotation type object from given annotation type

Parameters:
annotationType - annotation class type
Method Detail

invoke

public Object invoke(Object self,
                     Method m,
                     Method proceed,
                     Object[] args)
              throws InvocationTargetException,
                     IllegalAccessException
Javassist proxy object method handler. It is used in equality comparison with Annotation types.

If method is not implemented by this proxy, then proceed method is null. So, if the method is in the implemented annotation member method, then it is taken from the map values of this annotation member values.

Specified by:
invoke in interface javassist.util.proxy.MethodHandler
Parameters:
self - proxy object
m - method invoked method
proceed - actual method on this proxy object self
args - method arguments
Throws:
Exception - if any exception occurs
InvocationTargetException
IllegalAccessException

getAnnotationMembersValueMap

public Map<String,Object> getAnnotationMembersValueMap()
Gets

Returns:
the unmodifiable map

annotationType

public Class<? extends Annotation> annotationType()
Specified by:
annotationType in interface Annotation

setMemberValue

public void setMemberValue(String memberName,
                           Object memberValue)

toString

public String toString()
Specified by:
toString in interface Annotation
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Specified by:
equals in interface Annotation
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Annotation
Overrides:
hashCode in class Object


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.