org.jboss.webbeans.introspector
Interface AnnotatedItem<T,S>

All Known Subinterfaces:
AnnotatedAnnotation<T>, AnnotatedClass<T>, AnnotatedConstructor<T>, AnnotatedField<T>, AnnotatedInjectionPoint<T,S>, AnnotatedMember<T,S>, AnnotatedMethod<T>, AnnotatedParameter<T>, AnnotatedType<T>
All Known Implementing Classes:
AbstractAnnotatedItem, AbstractAnnotatedMember, AbstractAnnotatedType, AnnotatedAnnotationImpl, AnnotatedClassImpl, AnnotatedConstructorImpl, AnnotatedFieldImpl, AnnotatedMethodImpl, AnnotatedParameterImpl, ConstructorInjectionPoint, FieldInjectionPoint, ForwardingAnnotatedAnnotation, ForwardingAnnotatedClass, ForwardingAnnotatedConstructor, ForwardingAnnotatedField, ForwardingAnnotatedItem, ForwardingAnnotatedMember, ForwardingAnnotatedMethod, ForwardingAnnotatedParameter, ForwardingAnnotatedType, MethodInjectionPoint, ParameterInjectionPoint, ResolvableAnnotatedClass, WrappedAnnotatedClass, WrappedAnnotatedField, WrappedAnnotatedMethod, WrappedAnnotatedParameter

public interface AnnotatedItem<T,S>

AnnotatedItem provides a uniform access to the annotations on an annotated item defined either in Java or XML

Author:
Pete Muir

Field Summary
static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> MAPPED_METAANNOTATIONS
           
 
Method Summary
 java.lang.reflect.Type[] getActualTypeArguments()
          Gets the actual type arguments for any parameterized types that this AnnotatedItem represents.
<A extends java.lang.annotation.Annotation>
A
getAnnotation(java.lang.Class<A> annotationType)
          Gets an annotation for the annotation type specified.
<A extends java.lang.annotation.Annotation>
java.util.Set<A>
getAnnotationsAsSet()
          Gets all annotations on the item
 AnnotationStore getAnnotationStore()
           
 java.util.Set<java.lang.annotation.Annotation> getBindings()
          Deprecated. This reflection type should not know about JSR-299 binding types
 java.lang.annotation.Annotation[] getBindingsAsArray()
          Deprecated. This reflection type should not know about JSR-299 binding types
 java.util.Set<java.lang.annotation.Annotation> getDeclaredMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
          Gets all annotations which are declared on this annotated item with the given meta annotation type
 java.util.Set<? extends java.lang.reflect.Type> getFlattenedTypeHierarchy()
           
 java.util.Set<java.lang.annotation.Annotation> getMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
          Gets all annotations which are annotated with the given meta annotation type
 java.lang.annotation.Annotation[] getMetaAnnotationsAsArray(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
          Gets all annotations which are annotated with the given meta annotation type
 java.lang.String getName()
          Gets the name of this AnnotatedItem If it is not possible to determine the name of the underling element, a IllegalArgumentException is thrown
 java.lang.Class<T> getRawType()
          Gets the type of the element
 java.lang.reflect.Type getType()
           
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Indicates if an annotation type specified is present
 boolean isAssignableFrom(AnnotatedItem<?,?> that)
          Extends Java Class assignability such that actual type parameters are also considered
 boolean isAssignableFrom(java.util.Set<? extends java.lang.reflect.Type> types)
          Checks if any of the types provided are assignable to this, using the extended assignability algorithm provided by AnnotatedItem.
 boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Indicates if an annotation type specified is present
 boolean isFinal()
          Indicates if this AnnotatedItem represents a final element
 boolean isParameterizedType()
           
 boolean isProxyable()
          Indicates if this AnnotatedItem can be proxyed
 boolean isPublic()
          Indicates if this annotated item is public
 boolean isStatic()
          Indicates if this AnnotatedItem represents a static element
 

Field Detail

MAPPED_METAANNOTATIONS

static final java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> MAPPED_METAANNOTATIONS
Method Detail

getAnnotationsAsSet

<A extends java.lang.annotation.Annotation> java.util.Set<A> getAnnotationsAsSet()
Gets all annotations on the item

Returns:
A set of annotations. Returns an empty set if there are no matches.

getMetaAnnotations

java.util.Set<java.lang.annotation.Annotation> getMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Gets all annotations which are annotated with the given meta annotation type

Parameters:
The - meta annotation to match
Returns:
A set of matching meta-annotations. Returns an empty set if there are no matches.

getDeclaredMetaAnnotations

java.util.Set<java.lang.annotation.Annotation> getDeclaredMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Gets all annotations which are declared on this annotated item with the given meta annotation type

Parameters:
The - meta annotation to match
Returns:
A set of matching meta-annotations. Returns an empty set if there are no matches.

getMetaAnnotationsAsArray

java.lang.annotation.Annotation[] getMetaAnnotationsAsArray(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Gets all annotations which are annotated with the given meta annotation type

Parameters:
The - meta annotation to match
Returns:
An array of matching meta-annotations. Returns an empty array if there are no matches.

getBindings

java.util.Set<java.lang.annotation.Annotation> getBindings()
Deprecated. This reflection type should not know about JSR-299 binding types

Gets the binding types for this element


getBindingsAsArray

java.lang.annotation.Annotation[] getBindingsAsArray()
Deprecated. This reflection type should not know about JSR-299 binding types

Gets the binding types for this element


getAnnotation

<A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
Gets an annotation for the annotation type specified.

Parameters:
annotationType - The annotation to match
Returns:
An annotation if found, null if the annotation wasn't present.

getFlattenedTypeHierarchy

java.util.Set<? extends java.lang.reflect.Type> getFlattenedTypeHierarchy()

isAnnotationPresent

boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Indicates if an annotation type specified is present

Parameters:
annotationType - The annotation to match
Returns:
True if present, false if not

isDeclaredAnnotationPresent

boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Indicates if an annotation type specified is present

Parameters:
annotationType - The annotation to match
Returns:
True if present, false if not

getRawType

java.lang.Class<T> getRawType()
Gets the type of the element

Returns:
The type of the element

getType

java.lang.reflect.Type getType()

isAssignableFrom

boolean isAssignableFrom(AnnotatedItem<?,?> that)
Extends Java Class assignability such that actual type parameters are also considered

Parameters:
that - The other item to check assignability against
Returns:
True if assignable, false otherwise.

isAssignableFrom

boolean isAssignableFrom(java.util.Set<? extends java.lang.reflect.Type> types)
Checks if any of the types provided are assignable to this, using the extended assignability algorithm provided by AnnotatedItem. The types are assumed to contain their own actual type parameterization.

Parameters:
types - The set of types to match
Returns:
True if assignable, false otherwise.

getActualTypeArguments

java.lang.reflect.Type[] getActualTypeArguments()
Gets the actual type arguments for any parameterized types that this AnnotatedItem represents.

Returns:
An array of type arguments

isStatic

boolean isStatic()
Indicates if this AnnotatedItem represents a static element

Returns:
True if static, false otherwise

isFinal

boolean isFinal()
Indicates if this AnnotatedItem represents a final element

Returns:
True if final, false otherwise

isProxyable

boolean isProxyable()
Indicates if this AnnotatedItem can be proxyed

Returns:
True if proxyable, false otherwise

isPublic

boolean isPublic()
Indicates if this annotated item is public

Returns:
if public, returns true

getName

java.lang.String getName()
Gets the name of this AnnotatedItem If it is not possible to determine the name of the underling element, a IllegalArgumentException is thrown

Returns:
The name

getAnnotationStore

AnnotationStore getAnnotationStore()

isParameterizedType

boolean isParameterizedType()


Copyright © 2011. All Rights Reserved.