org.jboss.webbeans.introspector
Class ForwardingAnnotatedItem<T,S>

java.lang.Object
  extended by org.jboss.webbeans.introspector.ForwardingAnnotatedItem<T,S>
Type Parameters:
T -
S -
All Implemented Interfaces:
AnnotatedItem<T,S>
Direct Known Subclasses:
ForwardingAnnotatedMember, ForwardingAnnotatedParameter, ForwardingAnnotatedType

public abstract class ForwardingAnnotatedItem<T,S>
extends java.lang.Object
implements AnnotatedItem<T,S>

Provides an abstraction for delegating access to an annotated item

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
MAPPED_METAANNOTATIONS
 
Constructor Summary
ForwardingAnnotatedItem()
           
 
Method Summary
protected abstract  AnnotatedItem<T,S> delegate()
          Gets the annotated item
 boolean equals(java.lang.Object obj)
          Overridden method into delegate
 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.
 java.util.Set<java.lang.annotation.Annotation> getAnnotationsAsSet()
          Gets all annotations on the item
 AnnotationStore getAnnotationStore()
           
 java.util.Set<java.lang.annotation.Annotation> getBindings()
          Deprecated. 
 java.lang.annotation.Annotation[] getBindingsAsArray()
          Deprecated. 
 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()
           
 int hashCode()
          Overridden method into delegate
 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
 java.lang.String toString()
          Overridden method into delegate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForwardingAnnotatedItem

public ForwardingAnnotatedItem()
Method Detail

getActualTypeArguments

public java.lang.reflect.Type[] getActualTypeArguments()
Description copied from interface: AnnotatedItem
Gets the actual type arguments for any parameterized types that this AnnotatedItem represents.

Specified by:
getActualTypeArguments in interface AnnotatedItem<T,S>
Returns:
An array of type arguments
See Also:
AnnotatedItem

getAnnotation

public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
Description copied from interface: AnnotatedItem
Gets an annotation for the annotation type specified.

Specified by:
getAnnotation in interface AnnotatedItem<T,S>
Parameters:
annotationType - The annotation to match
Returns:
An annotation if found, null if the annotation wasn't present.
See Also:
AnnotatedItem

getAnnotationsAsSet

public java.util.Set<java.lang.annotation.Annotation> getAnnotationsAsSet()
Description copied from interface: AnnotatedItem
Gets all annotations on the item

Specified by:
getAnnotationsAsSet in interface AnnotatedItem<T,S>
Returns:
A set of annotations. Returns an empty set if there are no matches.
See Also:
AnnotatedItem

getMetaAnnotations

public java.util.Set<java.lang.annotation.Annotation> getMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Description copied from interface: AnnotatedItem
Gets all annotations which are annotated with the given meta annotation type

Specified by:
getMetaAnnotations in interface AnnotatedItem<T,S>
Returns:
A set of matching meta-annotations. Returns an empty set if there are no matches.
See Also:
AnnotatedItem

getMetaAnnotationsAsArray

public java.lang.annotation.Annotation[] getMetaAnnotationsAsArray(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Description copied from interface: AnnotatedItem
Gets all annotations which are annotated with the given meta annotation type

Specified by:
getMetaAnnotationsAsArray in interface AnnotatedItem<T,S>
Returns:
An array of matching meta-annotations. Returns an empty array if there are no matches.
See Also:
AnnotatedItem

getBindings

@Deprecated
public java.util.Set<java.lang.annotation.Annotation> getBindings()
Deprecated. 

Description copied from interface: AnnotatedItem
Gets the binding types for this element

Specified by:
getBindings in interface AnnotatedItem<T,S>
See Also:
AnnotatedItem

getBindingsAsArray

@Deprecated
public java.lang.annotation.Annotation[] getBindingsAsArray()
Deprecated. 

Description copied from interface: AnnotatedItem
Gets the binding types for this element

Specified by:
getBindingsAsArray in interface AnnotatedItem<T,S>
See Also:
AnnotatedItem

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: AnnotatedItem
Indicates if an annotation type specified is present

Specified by:
isAnnotationPresent in interface AnnotatedItem<T,S>
Parameters:
annotationType - The annotation to match
Returns:
True if present, false if not
See Also:
AnnotatedItem

getDeclaredMetaAnnotations

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

Specified by:
getDeclaredMetaAnnotations in interface AnnotatedItem<T,S>
Returns:
A set of matching meta-annotations. Returns an empty set if there are no matches.

getName

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

Specified by:
getName in interface AnnotatedItem<T,S>
Returns:
The name
See Also:
AnnotatedItem

getRawType

public java.lang.Class<T> getRawType()
Description copied from interface: AnnotatedItem
Gets the type of the element

Specified by:
getRawType in interface AnnotatedItem<T,S>
Returns:
The type of the element
See Also:
AnnotatedItem

getType

public java.lang.reflect.Type getType()
Specified by:
getType in interface AnnotatedItem<T,S>

isAssignableFrom

public boolean isAssignableFrom(AnnotatedItem<?,?> that)
Description copied from interface: AnnotatedItem
Extends Java Class assignability such that actual type parameters are also considered

Specified by:
isAssignableFrom in interface AnnotatedItem<T,S>
Parameters:
that - The other item to check assignability against
Returns:
True if assignable, false otherwise.
See Also:
AnnotatedItem

isAssignableFrom

public boolean isAssignableFrom(java.util.Set<? extends java.lang.reflect.Type> types)
Description copied from interface: AnnotatedItem
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.

Specified by:
isAssignableFrom in interface AnnotatedItem<T,S>
Parameters:
types - The set of types to match
Returns:
True if assignable, false otherwise.
See Also:
AnnotatedItem

isFinal

public boolean isFinal()
Description copied from interface: AnnotatedItem
Indicates if this AnnotatedItem represents a final element

Specified by:
isFinal in interface AnnotatedItem<T,S>
Returns:
True if final, false otherwise
See Also:
AnnotatedItem

isStatic

public boolean isStatic()
Description copied from interface: AnnotatedItem
Indicates if this AnnotatedItem represents a static element

Specified by:
isStatic in interface AnnotatedItem<T,S>
Returns:
True if static, false otherwise
See Also:
AnnotatedItem

isProxyable

public boolean isProxyable()
Description copied from interface: AnnotatedItem
Indicates if this AnnotatedItem can be proxyed

Specified by:
isProxyable in interface AnnotatedItem<T,S>
Returns:
True if proxyable, false otherwise
See Also:
AnnotatedItem

isPublic

public boolean isPublic()
Description copied from interface: AnnotatedItem
Indicates if this annotated item is public

Specified by:
isPublic in interface AnnotatedItem<T,S>
Returns:
if public, returns true

equals

public boolean equals(java.lang.Object obj)
Overridden method into delegate

Overrides:
equals in class java.lang.Object
See Also:
AnnotatedItem

hashCode

public int hashCode()
Overridden method into delegate

Overrides:
hashCode in class java.lang.Object
See Also:
AnnotatedItem

toString

public java.lang.String toString()
Overridden method into delegate

Overrides:
toString in class java.lang.Object
See Also:
AnnotatedItem

delegate

protected abstract AnnotatedItem<T,S> delegate()
Gets the annotated item

Returns:
The annotated item

getAnnotationStore

public AnnotationStore getAnnotationStore()
Specified by:
getAnnotationStore in interface AnnotatedItem<T,S>

isDeclaredAnnotationPresent

public boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: AnnotatedItem
Indicates if an annotation type specified is present

Specified by:
isDeclaredAnnotationPresent in interface AnnotatedItem<T,S>
Parameters:
annotationType - The annotation to match
Returns:
True if present, false if not

getFlattenedTypeHierarchy

public java.util.Set<? extends java.lang.reflect.Type> getFlattenedTypeHierarchy()
Specified by:
getFlattenedTypeHierarchy in interface AnnotatedItem<T,S>

isParameterizedType

public boolean isParameterizedType()
Specified by:
isParameterizedType in interface AnnotatedItem<T,S>


Copyright © 2011. All Rights Reserved.