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_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS
 
Constructor Summary
  AbstractWeldAnnotated(java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> annotationMap, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> declaredAnnotationMap, ClassTransformer classTransformer, java.lang.Class<T> rawType, java.lang.reflect.Type type, java.util.Set<java.lang.reflect.Type> typeClosure)
          Constructor Also builds the meta-annotation map.
protected AbstractWeldAnnotated(java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> annotationMap, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> declaredAnnotationMap, TypeStore typeStore)
           
 
Method Summary
protected static void addMetaAnnotations(com.google.common.collect.SetMultimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> metaAnnotationMap, java.lang.annotation.Annotation annotation, java.lang.annotation.Annotation[] metaAnnotations, boolean declared)
           
protected static void addMetaAnnotations(com.google.common.collect.SetMultimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> metaAnnotationMap, java.lang.annotation.Annotation annotation, java.lang.Iterable<java.lang.annotation.Annotation> metaAnnotations, boolean declared)
           
protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> buildAnnotationMap(java.lang.annotation.Annotation[] annotations)
          Builds the annotation map (annotation type -> annotation)
protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> buildAnnotationMap(java.lang.Iterable<java.lang.annotation.Annotation> annotations)
          Builds the annotation map (annotation type -> annotation)
 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()
           
 java.lang.reflect.Type getBaseType()
           
 java.lang.annotation.Annotation[] getBindingsAsArray()
          Deprecated. 
abstract  S getDelegate()
           
 java.util.Set<java.lang.reflect.Type> getInterfaceClosure()
          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.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> annotationType)
           
 boolean isParameterizedType()
           
 boolean isPrimitive()
           
 boolean isProxyable()
          Indicates if the type is proxyable to a set of pre-defined rules
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getName, getPackage, isFinal, isPackagePrivate, isPrivate, isPublic, isStatic
 

Constructor Detail

AbstractWeldAnnotated

public AbstractWeldAnnotated(java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> annotationMap,
                             java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> declaredAnnotationMap,
                             ClassTransformer classTransformer,
                             java.lang.Class<T> rawType,
                             java.lang.reflect.Type type,
                             java.util.Set<java.lang.reflect.Type> typeClosure)
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

protected AbstractWeldAnnotated(java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> annotationMap,
                                java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> declaredAnnotationMap,
                                TypeStore typeStore)
Method Detail

buildAnnotationMap

protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> buildAnnotationMap(java.lang.annotation.Annotation[] annotations)
Builds the annotation map (annotation type -> annotation)

Parameters:
annotations - The array of annotations to map
Returns:
The annotation map

buildAnnotationMap

protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> buildAnnotationMap(java.lang.Iterable<java.lang.annotation.Annotation> annotations)
Builds the annotation map (annotation type -> annotation)

Parameters:
annotations - The array of annotations to map
Returns:
The annotation map

addMetaAnnotations

protected static void addMetaAnnotations(com.google.common.collect.SetMultimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> metaAnnotationMap,
                                         java.lang.annotation.Annotation annotation,
                                         java.lang.annotation.Annotation[] metaAnnotations,
                                         boolean declared)

addMetaAnnotations

protected static void addMetaAnnotations(com.google.common.collect.SetMultimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> metaAnnotationMap,
                                         java.lang.annotation.Annotation annotation,
                                         java.lang.Iterable<java.lang.annotation.Annotation> metaAnnotations,
                                         boolean declared)

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

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

getInterfaceClosure

public java.util.Set<java.lang.reflect.Type> getInterfaceClosure()
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. There is no guarantee this methods executes in O(1) time

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

getDelegate

public abstract S getDelegate()

isParameterizedType

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

isPrimitive

public boolean isPrimitive()
Specified by:
isPrimitive 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

getAnnotations

public java.util.Set<java.lang.annotation.Annotation> getAnnotations()
Specified by:
getAnnotations 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.

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. 

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

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

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

isAnnotationPresent

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


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