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, WeldClassImpl, WeldParameterImpl

public abstract class AbstractWeldAnnotated<T,S>
extends 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(Map<Class<? extends Annotation>,Annotation> annotationMap, Map<Class<? extends Annotation>,Annotation> declaredAnnotationMap, ClassTransformer classTransformer, Class<T> rawType, Type type, LazyValueHolder<Set<Type>> typeClosure)
          Constructor

Also builds the meta-annotation map.

 
Method Summary
protected static void addMetaAnnotations(ArraySetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap, Annotation annotation, Annotation[] metaAnnotations, boolean declared)
           
protected static void addMetaAnnotations(ArraySetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap, Annotation annotation, Iterable<Annotation> metaAnnotations, boolean declared)
           
protected static Map<Class<? extends Annotation>,Annotation> buildAnnotationMap(Annotation[] annotations)
          Builds the annotation map (annotation type -> annotation)
protected static Map<Class<? extends Annotation>,Annotation> buildAnnotationMap(Iterable<Annotation> annotations)
          Builds the annotation map (annotation type -> annotation)
 Type[] getActualTypeArguments()
          Gets the actual type arguments for any parameterized types that this AnnotatedItem represents.
<A extends Annotation>
A
getAnnotation(Class<A> annotationType)
           
 Set<Annotation> getAnnotations()
           
 Type getBaseType()
           
 Annotation[] getBindingsAsArray()
          Deprecated. 
abstract  S getDelegate()
           
 Set<Type> getInterfaceClosure()
          Get the type hierarchy of any interfaces implemented by this class.
 Class<T> getJavaClass()
          Gets the type of the element
 Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
          Gets all annotations which are annotated with the given meta annotation type
 Set<Annotation> getQualifiers()
          Deprecated. 
 Set<Type> getTypeClosure()
           
 boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
           
 boolean isParameterizedType()
           
 boolean isPrimitive()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getName, getPackage, isFinal, isGeneric, isPackagePrivate, isPrivate, isPublic, isStatic
 

Constructor Detail

AbstractWeldAnnotated

public AbstractWeldAnnotated(Map<Class<? extends Annotation>,Annotation> annotationMap,
                             Map<Class<? extends Annotation>,Annotation> declaredAnnotationMap,
                             ClassTransformer classTransformer,
                             Class<T> rawType,
                             Type type,
                             LazyValueHolder<Set<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
Method Detail

buildAnnotationMap

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

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

buildAnnotationMap

protected static Map<Class<? extends Annotation>,Annotation> buildAnnotationMap(Iterable<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(ArraySetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap,
                                         Annotation annotation,
                                         Annotation[] metaAnnotations,
                                         boolean declared)

addMetaAnnotations

protected static void addMetaAnnotations(ArraySetMultimap<Class<? extends Annotation>,Annotation> metaAnnotationMap,
                                         Annotation annotation,
                                         Iterable<Annotation> metaAnnotations,
                                         boolean declared)

getJavaClass

public 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 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 Set<Type> getInterfaceClosure()
Description copied from interface: WeldAnnotated
Get the type hierarchy of any interfaces implemented by this class.

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 Type getBaseType()
Specified by:
getBaseType in interface javax.enterprise.inject.spi.Annotated

getTypeClosure

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

getAnnotations

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

getMetaAnnotations

public Set<Annotation> getMetaAnnotations(Class<? extends 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 Set<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 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 Annotation> A getAnnotation(Class<A> annotationType)
Specified by:
getAnnotation in interface javax.enterprise.inject.spi.Annotated

isAnnotationPresent

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


Copyright © 2013 Seam Framework. All Rights Reserved.