org.jboss.aop.annotation
Class AnnotationElement

java.lang.Object
  extended by org.jboss.aop.annotation.PortableAnnotationElement
      extended by org.jboss.aop.annotation.AnnotationElement

public class AnnotationElement
extends PortableAnnotationElement

Bridge/portability class for resolving annotations in JDK 1.4 and JDK1.5 Should be usable in JDK 1.4 and also should support finding invisible annotations. This would be needed for aspect bindings

Version:
$Revision: 70836 $
Author:
Bill Burke

Constructor Summary
AnnotationElement()
           
 
Method Summary
static
<T extends Annotation>
T
getVisibleAnnotation(Class<?> clazz, Class<T> annotation)
          If class has a visible annotation, return it.
static
<T extends Annotation>
T
getVisibleAnnotation(Constructor<?> con, Class<T> annotation)
          If constructor has visible annotation return it.
static
<T extends Annotation>
T
getVisibleAnnotation(Field field, Class<T> annotation)
          If field has a visible annotation return it.
static
<T extends Annotation>
T
getVisibleAnnotation(Method method, Class<T> annotation)
          Get a visible annotation for a particle Method.
static Annotation[] getVisibleAnnotations(Class<?> clazz)
           
static Annotation[] getVisibleAnnotations(Constructor<?> c)
           
static Annotation[] getVisibleAnnotations(Field f)
           
static Annotation[] getVisibleAnnotations(Method m)
           
static boolean isVisibleAnnotationPresent(Class<?> clazz, Class<? extends Annotation> annotation)
           
static boolean isVisibleAnnotationPresent(Class<?> clazz, String annotation)
           
static boolean isVisibleAnnotationPresent(Constructor<?> con, Class<? extends Annotation> annotation)
           
static boolean isVisibleAnnotationPresent(Constructor<?> con, String annotation)
           
static boolean isVisibleAnnotationPresent(Field f, Class<? extends Annotation> annotation)
           
static boolean isVisibleAnnotationPresent(Field f, String annotation)
           
static boolean isVisibleAnnotationPresent(Method m, Class<? extends Annotation> annotation)
           
static boolean isVisibleAnnotationPresent(Method m, String annotation)
           
 
Methods inherited from class org.jboss.aop.annotation.PortableAnnotationElement
create, getAnyAnnotation, getAnyAnnotation, getAnyAnnotation, getAnyAnnotation, getClassFile, getInvisibleAnnotation, getInvisibleAnnotation, getInvisibleAnnotation, getInvisibleAnnotation, includeInvisibleAnnotation, includeInvisibleAnnotation, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isAnyAnnotationPresent, isInvisibleAnnotationPresent, isInvisibleAnnotationPresent, isInvisibleAnnotationPresent, isInvisibleAnnotationPresent, isInvisibleAnnotationPresent, isInvisibleAnnotationPresent, isVisibleAnnotationPresent, isVisibleAnnotationPresent, setClosingDownManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationElement

public AnnotationElement()
Method Detail

getVisibleAnnotation

public static <T extends Annotation> T getVisibleAnnotation(Method method,
                                                            Class<T> annotation)
Get a visible annotation for a particle Method. If this is JDK 1.5 then this is a wrapper for Method.getAnnotation

Parameters:
method -
annotation -
Returns:

getVisibleAnnotation

public static <T extends Annotation> T getVisibleAnnotation(Constructor<?> con,
                                                            Class<T> annotation)
If constructor has visible annotation return it. If this is JDK 1.5 this is a wrapper for Constructor.getAnnotation()

Parameters:
con -
annotation -
Returns:

getVisibleAnnotation

public static <T extends Annotation> T getVisibleAnnotation(Field field,
                                                            Class<T> annotation)
If field has a visible annotation return it. If this is JDK 1.5 this is a wrapper for Field.getAnnotation.

Parameters:
field -
annotation -
Returns:

getVisibleAnnotation

public static <T extends Annotation> T getVisibleAnnotation(Class<?> clazz,
                                                            Class<T> annotation)
If class has a visible annotation, return it. If this is JDK 1.5 this is a wrapper for Class.getAnnotation

Parameters:
clazz -
annotation -
Returns:

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Class<?> clazz,
                                                 Class<? extends Annotation> annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Method m,
                                                 Class<? extends Annotation> annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Field f,
                                                 Class<? extends Annotation> annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Constructor<?> con,
                                                 Class<? extends Annotation> annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Class<?> clazz,
                                                 String annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Method m,
                                                 String annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Field f,
                                                 String annotation)

isVisibleAnnotationPresent

public static boolean isVisibleAnnotationPresent(Constructor<?> con,
                                                 String annotation)

getVisibleAnnotations

public static Annotation[] getVisibleAnnotations(Class<?> clazz)
                                          throws Exception
Throws:
Exception

getVisibleAnnotations

public static Annotation[] getVisibleAnnotations(Method m)
                                          throws Exception
Throws:
Exception

getVisibleAnnotations

public static Annotation[] getVisibleAnnotations(Field f)
                                          throws Exception
Throws:
Exception

getVisibleAnnotations

public static Annotation[] getVisibleAnnotations(Constructor<?> c)
                                          throws Exception
Throws:
Exception


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.