org.jboss.weld.introspector.jlr
Class AbstractWeldAnnotated<T,S>

java.lang.Object
  extended by org.jboss.weld.introspector.jlr.AbstractWeldAnnotated<T,S>
Type Parameters:
T -
S -
All Implemented Interfaces:
javax.enterprise.inject.spi.Annotated, WeldAnnotated<T,S>
Direct Known Subclasses:
AbstractWeldMember, ResolvableWeldClass, WeldClassImpl, WeldParameterImpl

public abstract class AbstractWeldAnnotated<T,S>
extends java.lang.Object
implements WeldAnnotated<T,S>

Represents functionality common for all annotated items, mainly different mappings of the annotations and meta-annotations AbstractAnnotatedItem is an immutable class and therefore threadsafe

Author:
Pete Muir, Nicklas Karlsson
See Also:
WeldAnnotated

Field Summary
 
Fields inherited from interface org.jboss.weld.introspector.WeldAnnotated
MAPPED_METAANNOTATIONS
 
Constructor Summary
AbstractWeldAnnotated(AnnotationStore annotatedItemHelper)
           
AbstractWeldAnnotated(AnnotationStore annotatedItemHelper, java.lang.Class<T> rawType, java.lang.reflect.Type type)
          Constructor Also builds the meta-annotation map.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares two AbstractAnnotatedItems
 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)
           
 java.util.Set<java.lang.annotation.Annotation> getAnnotations()
           
 AnnotationStore getAnnotationStore()
           
 java.lang.reflect.Type getBaseType()
           
 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
abstract  S getDelegate()
           
 java.util.Set<java.lang.reflect.Type> getInterfaceOnlyFlattenedTypeHierarchy()
          Get the type hierarchy of any interfaces implemented by this class.
 java.lang.Class<T> getJavaClass()
          Gets the type of the element
 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.util.Set<java.lang.annotation.Annotation> getQualifiers()
          Deprecated. 
 java.util.Set<java.lang.reflect.Type> getTypeClosure()
           
 int hashCode()
          Gets the hash code of the actual type
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotatedType)
          Checks if an annotation is present on the item
 boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Indicates if an annotation type specified is present
 boolean isParameterizedType()
           
 boolean isProxyable()
          Indicates if the type is proxyable to a set of pre-defined rules
 java.lang.String toString()
          Gets a string representation of the item
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getName, getPackage, isFinal, isPackagePrivate, isPrivate, isPublic, isStatic
 

Constructor Detail

AbstractWeldAnnotated

public AbstractWeldAnnotated(AnnotationStore annotatedItemHelper,
                             java.lang.Class<T> rawType,
                             java.lang.reflect.Type type)
Constructor Also builds the meta-annotation map. Throws a NullPointerException if trying to register a null map

Parameters:
annotationMap - A map of annotation to register

AbstractWeldAnnotated

public AbstractWeldAnnotated(AnnotationStore annotatedItemHelper)
Method Detail

getAnnotationStore

public AnnotationStore getAnnotationStore()

getAnnotation

public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
Specified by:
getAnnotation in interface javax.enterprise.inject.spi.Annotated

getMetaAnnotations

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

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

getDeclaredMetaAnnotations

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

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

getMetaAnnotationsAsArray

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

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

getAnnotations

public java.util.Set<java.lang.annotation.Annotation> getAnnotations()
Specified by:
getAnnotations in interface javax.enterprise.inject.spi.Annotated

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotatedType)
Checks if an annotation is present on the item

Specified by:
isAnnotationPresent in interface javax.enterprise.inject.spi.Annotated
Parameters:
annotatedType - The annotation type to check for
Returns:
True if present, false otherwise.
See Also:
Annotated.isAnnotationPresent(Class)

equals

public boolean equals(java.lang.Object other)
Compares two AbstractAnnotatedItems

Overrides:
equals in class java.lang.Object
Parameters:
other - The other item
Returns:
True if equals, false otherwise

hashCode

public int hashCode()
Gets the hash code of the actual type

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code

toString

public java.lang.String toString()
Gets a string representation of the item

Overrides:
toString in class java.lang.Object
Returns:
A string representation

getQualifiers

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

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

Specified by:
getQualifiers in interface WeldAnnotated<T,S>

getBindingsAsArray

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

Gets (as array) the binding types of the item Looks at the meta-annotations map for annotations with binding type meta-annotation. Returns default binding (current) if none specified.

Specified by:
getBindingsAsArray in interface WeldAnnotated<T,S>
Returns:
An array of (binding type) annotations
See Also:
WeldAnnotated.getBindingsAsArray()

isProxyable

public boolean isProxyable()
Indicates if the type is proxyable to a set of pre-defined rules

Specified by:
isProxyable in interface WeldAnnotated<T,S>
Returns:
True if proxyable, false otherwise.
See Also:
WeldAnnotated.isProxyable()

getJavaClass

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

Specified by:
getJavaClass in interface WeldAnnotated<T,S>
Returns:
The type of the element

getActualTypeArguments

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

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

getInterfaceOnlyFlattenedTypeHierarchy

public java.util.Set<java.lang.reflect.Type> getInterfaceOnlyFlattenedTypeHierarchy()
Description copied from interface: WeldAnnotated
Get the type hierarchy of any interfaces implemented by this class. Interface hierarchies from super classes are not included. The returned types should have any type parameters resolved to their actual types.

Specified by:
getInterfaceOnlyFlattenedTypeHierarchy in interface WeldAnnotated<T,S>
Returns:
the type hierarchy

getDelegate

public abstract S getDelegate()

isDeclaredAnnotationPresent

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

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

isParameterizedType

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

getBaseType

public java.lang.reflect.Type getBaseType()
Specified by:
getBaseType in interface javax.enterprise.inject.spi.Annotated

getTypeClosure

public java.util.Set<java.lang.reflect.Type> getTypeClosure()
Specified by:
getTypeClosure in interface javax.enterprise.inject.spi.Annotated


Copyright © 2008-2009 Seam Framework. All Rights Reserved.