edu.rice.cs.cunit.subAnnot
Interface AnnotatedElementEx

All Known Implementing Classes:
AAnnotatedElementEx, ClassEx, ConstructorEx, FieldEx, MethodEx, PackageEx

public interface AnnotatedElementEx

Interface for annotated elements supporting annotations with subtyping.

Author:
Mathias Ricken

Method Summary
 java.lang.annotation.Annotation[] getAnnotations()
          Return an array of all annotations attached to the element.
<A extends java.lang.annotation.Annotation>
java.util.List<A>
getAnnotations(java.lang.Class<A> c)
          Return an array of the annotations attached to the element that are subclasses of the specified class.
<A extends java.lang.annotation.Annotation>
java.util.List<A>
getAnnotations(ClassEx<A> c)
          Return an array of the annotations attached to the element that are subclasses of the specified class.
 java.lang.annotation.Annotation[] getDeclaredAnnotations()
          Return an array of all annotations attached directly to the element.
<A extends java.lang.annotation.Annotation>
java.util.List<A>
getDeclaredAnnotations(java.lang.Class<A> c)
          Return an array of the annotations attached to the element that are subclasses of the specified class.
<A extends java.lang.annotation.Annotation>
java.util.List<A>
getDeclaredAnnotations(ClassEx<A> c)
          Return an array of the annotations attached to the element that are subclasses of the specified class.
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> c)
          Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false.
 boolean isAnnotationPresent(ClassEx<? extends java.lang.annotation.Annotation> c)
          Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false.
 boolean isAvailable()
          Returns true if the class file was found and additional information is available beyond what Java's Class class might return.
 boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> c)
          Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false.
 boolean isDeclaredAnnotationPresent(ClassEx<? extends java.lang.annotation.Annotation> c)
          Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false.
 

Method Detail

isAvailable

boolean isAvailable()
Returns true if the class file was found and additional information is available beyond what Java's Class class might return.

Returns:
true if class file was found.

isAnnotationPresent

boolean isAnnotationPresent(ClassEx<? extends java.lang.annotation.Annotation> c)
Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false. This method is designed primarily for convenient access to marker annotations.

Parameters:
c - class
Returns:
true if present

isAnnotationPresent

boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> c)
Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false. This method is designed primarily for convenient access to marker annotations.

Parameters:
c - class
Returns:
true if present

getAnnotations

<A extends java.lang.annotation.Annotation> java.util.List<A> getAnnotations(ClassEx<A> c)
Return an array of the annotations attached to the element that are subclasses of the specified class.

Parameters:
c - class
Returns:
array of annotations

getAnnotations

<A extends java.lang.annotation.Annotation> java.util.List<A> getAnnotations(java.lang.Class<A> c)
Return an array of the annotations attached to the element that are subclasses of the specified class.

Parameters:
c - class
Returns:
array of annotations

getAnnotations

java.lang.annotation.Annotation[] getAnnotations()
Return an array of all annotations attached to the element.

Returns:
array of annotations

isDeclaredAnnotationPresent

boolean isDeclaredAnnotationPresent(ClassEx<? extends java.lang.annotation.Annotation> c)
Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false. This method is designed primarily for convenient access to marker annotations. Contrary to isAnnotationPresent, this does not consider annotations inherited from superclasses.

Parameters:
c - class
Returns:
true if present

isDeclaredAnnotationPresent

boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> c)
Returns true if an annotation for the specified type or one of its subtypes is present on this element, else false. This method is designed primarily for convenient access to marker annotations. Contrary to isAnnotationPresent, this does not consider annotations inherited from superclasses.

Parameters:
c - class
Returns:
true if present

getDeclaredAnnotations

<A extends java.lang.annotation.Annotation> java.util.List<A> getDeclaredAnnotations(ClassEx<A> c)
Return an array of the annotations attached to the element that are subclasses of the specified class. Contrary to getAnnotations, this does not consider annotations inherited from superclasses.

Parameters:
c - class
Returns:
array of annotations

getDeclaredAnnotations

<A extends java.lang.annotation.Annotation> java.util.List<A> getDeclaredAnnotations(java.lang.Class<A> c)
Return an array of the annotations attached to the element that are subclasses of the specified class. Contrary to isAnnotationPresent, this does not consider annotations inherited from superclasses.

Parameters:
c - class
Returns:
array of annotations

getDeclaredAnnotations

java.lang.annotation.Annotation[] getDeclaredAnnotations()
Return an array of all annotations attached directly to the element. Contrary to getAnnotations(), this does not consider annotations inherited from superclasses.

Returns:
array of annotations