org.jboss.weld.introspector.jlr
Class WeldClassImpl<T>

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

public class WeldClassImpl<T>
extends AbstractWeldAnnotated<T,java.lang.Class<T>>
implements WeldClass<T>

Represents an annotated class This class is immutable, and therefore threadsafe

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.weld.introspector.WeldAnnotated
MAPPED_METAANNOTATIONS
 
Constructor Summary
protected WeldClassImpl(java.lang.Class<T> rawType, java.lang.reflect.Type type, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, AnnotationStore annotationStore, ClassTransformer classTransformer)
           
 
Method Summary
<U> WeldClass<? extends U>
asWeldSubclass(WeldClass<U> clazz)
           
<S> S
cast(java.lang.Object object)
           
 java.lang.Class<? extends T> getAnnotatedClass()
          Gets the implementing class
 java.util.Set<WeldConstructor<T>> getAnnotatedWeldConstructors(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets constructors with given annotation type
 java.util.Set<WeldField<?,?>> getAnnotatedWeldFields(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets the abstracted field annotated with a specific annotation type If the fields map is null, initialize it first
 java.util.Set<WeldMethod<?,?>> getAnnotatedWeldMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets the abstracted methods that have a certain annotation type present If the annotated methods map is null, initialize it first
 java.util.Set<javax.enterprise.inject.spi.AnnotatedConstructor<T>> getConstructors()
           
 java.util.Set<WeldField<?,T>> getDeclaredAnnotatedWeldFields(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all fields which are annotated with the given annotation type on this class only.
 java.util.Set<WeldMethod<?,T>> getDeclaredAnnotatedWeldMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all methods annotated with annotationType
 java.util.Set<WeldField<?,?>> getDeclaredFields()
           
 WeldConstructor<T> getDeclaredWeldConstructor(ConstructorSignature signature)
          Get the constructor which matches the argument list provided
<F> WeldField<F,?>
getDeclaredWeldField(java.lang.String fieldName, WeldClass<F> expectedType)
          Get a field by name
 WeldMethod<?,?> getDeclaredWeldMethod(java.lang.reflect.Method method)
           
<M> WeldMethod<M,?>
getDeclaredWeldMethod(MethodSignature signature, WeldClass<M> expectedReturnType)
          Get a method by name
 java.util.Set<WeldMethod<?,?>> getDeclaredWeldMethods()
          Gets all fields on the type
 java.util.Set<WeldMethod<?,T>> getDeclaredWeldMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all with parameters annotated with annotationType
 java.lang.Class<T> getDelegate()
          Gets the delegate (class)
 java.util.Set<javax.enterprise.inject.spi.AnnotatedField<? super T>> getFields()
           
 java.util.Set<WeldField<?,?>> getMetaAnnotatedWeldFields(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
          Gets abstracted fields with requested meta-annotation type present If the meta-annotations map is null, it is initializes.
 java.util.Set<javax.enterprise.inject.spi.AnnotatedMethod<? super T>> getMethods()
           
 java.lang.String getName()
          Gets the name of the type
 WeldConstructor<T> getNoArgsWeldConstructor()
          Gets the no-args constructor
 java.lang.Package getPackage()
           
 java.lang.String getSimpleName()
           
<M> WeldMethod<M,?>
getWBMethod(MethodSignature signature)
          Get a method by name
 java.util.Set<WeldConstructor<T>> getWeldConstructors()
          Gets the abstracted constructors of the class Initializes the constructors if they are null
 java.util.Set<WeldConstructor<?>> getWeldConstructorsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all with constructors annotated with annotationType
 java.util.Set<WeldField<?,?>> getWeldFields()
          Gets the abstracted fields of the class Initializes the fields if they are null
 WeldMethod<?,?> getWeldMethod(java.lang.reflect.Method methodDescriptor)
          Find the annotated method for a given methodDescriptor
 java.util.Set<WeldMethod<?,?>> getWeldMethods()
          Gets all fields on the type
 java.util.Set<WeldMethod<?,?>> getWeldMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all with parameters annotated with annotationType
 WeldClass<?> getWeldSuperclass()
          Gets the superclass abstraction of the type
 boolean isAbstract()
           
 boolean isEnum()
           
 boolean isEquivalent(java.lang.Class<?> clazz)
          Check if this is equivalent to a java class
 boolean isFinal()
          Indicates if the type if final
 boolean isNonStaticMemberClass()
          Determine if this is a non-static member class
 boolean isPackagePrivate()
           
 boolean isPrivate()
           
 boolean isPublic()
          Indicates if this annotated item is public
 boolean isStatic()
          Indicates if the type is static
static
<T> WeldClass<T>
of(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, ClassTransformer classTransformer)
           
static
<T> WeldClass<T>
of(java.lang.Class<T> clazz, ClassTransformer classTransformer)
           
 java.lang.String toString()
          Gets a string representation of the class
 
Methods inherited from class org.jboss.weld.introspector.jlr.AbstractWeldAnnotated
equals, getActualTypeArguments, getAnnotation, getAnnotations, getAnnotationStore, getBaseType, getBindingsAsArray, getDeclaredMetaAnnotations, getInterfaceOnlyFlattenedTypeHierarchy, getJavaClass, getMetaAnnotations, getMetaAnnotationsAsArray, getQualifiers, getTypeClosure, hashCode, isAnnotationPresent, isDeclaredAnnotationPresent, isParameterizedType, isProxyable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldClass
isParameterizedType
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getActualTypeArguments, getBindingsAsArray, getDeclaredMetaAnnotations, getInterfaceOnlyFlattenedTypeHierarchy, getJavaClass, getMetaAnnotations, getMetaAnnotationsAsArray, getQualifiers, isDeclaredAnnotationPresent, isProxyable
 
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedType
getJavaClass
 
Methods inherited from interface javax.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresent
 

Constructor Detail

WeldClassImpl

protected WeldClassImpl(java.lang.Class<T> rawType,
                        java.lang.reflect.Type type,
                        javax.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                        AnnotationStore annotationStore,
                        ClassTransformer classTransformer)
Method Detail

of

public static <T> WeldClass<T> of(java.lang.Class<T> clazz,
                                  ClassTransformer classTransformer)

of

public static <T> WeldClass<T> of(javax.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                                  ClassTransformer classTransformer)

getAnnotatedClass

public java.lang.Class<? extends T> getAnnotatedClass()
Gets the implementing class

Returns:
The class

getDelegate

public java.lang.Class<T> getDelegate()
Gets the delegate (class)

Specified by:
getDelegate in class AbstractWeldAnnotated<T,java.lang.Class<T>>
Returns:
The class

getWeldFields

public java.util.Set<WeldField<?,?>> getWeldFields()
Gets the abstracted fields of the class Initializes the fields if they are null

Specified by:
getWeldFields in interface WeldClass<T>
Returns:
The set of abstracted fields

getDeclaredFields

public java.util.Set<WeldField<?,?>> getDeclaredFields()

getDeclaredWeldField

public <F> WeldField<F,?> getDeclaredWeldField(java.lang.String fieldName,
                                               WeldClass<F> expectedType)
Description copied from interface: WeldClass
Get a field by name

Specified by:
getDeclaredWeldField in interface WeldClass<T>
Type Parameters:
F - the expected type of the field
Parameters:
fieldName - the field name
expectedType - the expected type of the field
Returns:
the field

getDeclaredAnnotatedWeldFields

public java.util.Set<WeldField<?,T>> getDeclaredAnnotatedWeldFields(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: WeldClass
Gets all fields which are annotated with the given annotation type on this class only.

Specified by:
getDeclaredAnnotatedWeldFields in interface WeldClass<T>
Parameters:
annotationType - The annotation to match
Returns:
A set of abstracted fields with the given annotation. Returns an empty set if there are no matches

getWeldConstructors

public java.util.Set<WeldConstructor<T>> getWeldConstructors()
Gets the abstracted constructors of the class Initializes the constructors if they are null

Specified by:
getWeldConstructors in interface WeldClass<T>
Returns:
The set of abstracted constructors

getDeclaredWeldConstructor

public WeldConstructor<T> getDeclaredWeldConstructor(ConstructorSignature signature)
Description copied from interface: WeldClass
Get the constructor which matches the argument list provided

Specified by:
getDeclaredWeldConstructor in interface WeldClass<T>
Returns:
the matching constructor, or null if not defined

getMetaAnnotatedWeldFields

public java.util.Set<WeldField<?,?>> getMetaAnnotatedWeldFields(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Gets abstracted fields with requested meta-annotation type present If the meta-annotations map is null, it is initializes. If the annotated fields are null, it is initialized The meta-annotated field map is then populated for the requested meta-annotation type and the result is returned

Specified by:
getMetaAnnotatedWeldFields in interface WeldClass<T>
Parameters:
metaAnnotationType - The meta-annotation type to match
Returns:
The set of abstracted fields with meta-annotation present. Returns an empty set if no matches are found.

getAnnotatedWeldFields

public java.util.Set<WeldField<?,?>> getAnnotatedWeldFields(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets the abstracted field annotated with a specific annotation type If the fields map is null, initialize it first

Specified by:
getAnnotatedWeldFields in interface WeldClass<T>
Parameters:
annotationType - The annotation type to match
Returns:
A set of matching abstracted fields, null if none are found.

isNonStaticMemberClass

public boolean isNonStaticMemberClass()
Description copied from interface: WeldClass
Determine if this is a non-static member class

Specified by:
isNonStaticMemberClass in interface WeldClass<T>
Returns:
true if this is a non-static member

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface WeldClass<T>

isEnum

public boolean isEnum()
Specified by:
isEnum in interface WeldClass<T>

getAnnotatedWeldMethods

public java.util.Set<WeldMethod<?,?>> getAnnotatedWeldMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets the abstracted methods that have a certain annotation type present If the annotated methods map is null, initialize it first

Specified by:
getAnnotatedWeldMethods in interface WeldClass<T>
Parameters:
annotationType - The annotation type to match
Returns:
A set of matching method abstractions. Returns an empty set if no matches are found.
See Also:
WeldClass.getAnnotatedWeldMethods(Class)

getDeclaredAnnotatedWeldMethods

public java.util.Set<WeldMethod<?,T>> getDeclaredAnnotatedWeldMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: WeldClass
Gets all methods annotated with annotationType

Specified by:
getDeclaredAnnotatedWeldMethods in interface WeldClass<T>
Parameters:
annotationType - The annotation to match
Returns:
A set of abstracted methods with the given annotation. Returns an empty set if there are no matches

getAnnotatedWeldConstructors

public java.util.Set<WeldConstructor<T>> getAnnotatedWeldConstructors(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets constructors with given annotation type

Specified by:
getAnnotatedWeldConstructors in interface WeldClass<T>
Parameters:
annotationType - The annotation type to match
Returns:
A set of abstracted constructors with given annotation type. If the constructors set is empty, initialize it first. Returns an empty set if there are no matches.
See Also:
WeldClass.getAnnotatedWeldConstructors(Class)

getNoArgsWeldConstructor

public WeldConstructor<T> getNoArgsWeldConstructor()
Description copied from interface: WeldClass
Gets the no-args constructor

Specified by:
getNoArgsWeldConstructor in interface WeldClass<T>
Returns:
The no-args constructor, or null if not defined

getWeldMethodsWithAnnotatedParameters

public java.util.Set<WeldMethod<?,?>> getWeldMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: WeldClass
Gets all with parameters annotated with annotationType

Specified by:
getWeldMethodsWithAnnotatedParameters in interface WeldClass<T>
Parameters:
annotationType - The annotation to match
Returns:
A set of abstracted methods with the given annotation. Returns an empty set if there are no matches

getWeldConstructorsWithAnnotatedParameters

public java.util.Set<WeldConstructor<?>> getWeldConstructorsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: WeldClass
Gets all with constructors annotated with annotationType

Specified by:
getWeldConstructorsWithAnnotatedParameters in interface WeldClass<T>
Parameters:
annotationType - The annotation to match
Returns:
A set of abstracted constructors with the given annotation. Returns an empty set if there are no matches

getDeclaredWeldMethodsWithAnnotatedParameters

public java.util.Set<WeldMethod<?,T>> getDeclaredWeldMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: WeldClass
Gets all with parameters annotated with annotationType

Specified by:
getDeclaredWeldMethodsWithAnnotatedParameters in interface WeldClass<T>
Parameters:
annotationType - The annotation to match
Returns:
A set of abstracted methods with the given annotation. Returns an empty set if there are no matches

getWeldMethod

public WeldMethod<?,?> getWeldMethod(java.lang.reflect.Method methodDescriptor)
Description copied from interface: WeldClass
Find the annotated method for a given methodDescriptor

Specified by:
getWeldMethod in interface WeldClass<T>
Returns:

getWeldMethods

public java.util.Set<WeldMethod<?,?>> getWeldMethods()
Description copied from interface: WeldClass
Gets all fields on the type

Specified by:
getWeldMethods in interface WeldClass<T>
Returns:
A set of abstracted fields

getDeclaredWeldMethod

public WeldMethod<?,?> getDeclaredWeldMethod(java.lang.reflect.Method method)
Specified by:
getDeclaredWeldMethod in interface WeldClass<T>

getDeclaredWeldMethods

public java.util.Set<WeldMethod<?,?>> getDeclaredWeldMethods()
Description copied from interface: WeldClass
Gets all fields on the type

Specified by:
getDeclaredWeldMethods in interface WeldClass<T>
Returns:
A set of abstracted fields

getDeclaredWeldMethod

public <M> WeldMethod<M,?> getDeclaredWeldMethod(MethodSignature signature,
                                                 WeldClass<M> expectedReturnType)
Description copied from interface: WeldClass
Get a method by name

Specified by:
getDeclaredWeldMethod in interface WeldClass<T>
Type Parameters:
M - the expected return type
Parameters:
signature - the name of the method
expectedReturnType - the expected return type
Returns:
the method, or null if it doesn't exist

getWBMethod

public <M> WeldMethod<M,?> getWBMethod(MethodSignature signature)
Description copied from interface: WeldClass
Get a method by name

Specified by:
getWBMethod in interface WeldClass<T>
Type Parameters:
M - the expected return type
Parameters:
signature - the name of the method
Returns:
the method, or null if it doesn't exist

toString

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

Overrides:
toString in class AbstractWeldAnnotated<T,java.lang.Class<T>>
Returns:
A string representation

getSimpleName

public java.lang.String getSimpleName()
Specified by:
getSimpleName in interface WeldClass<T>

isStatic

public boolean isStatic()
Indicates if the type is static

Specified by:
isStatic in interface WeldAnnotated<T,java.lang.Class<T>>
Returns:
True if static, false otherwise
See Also:
WeldAnnotated.isStatic()

isFinal

public boolean isFinal()
Indicates if the type if final

Specified by:
isFinal in interface WeldAnnotated<T,java.lang.Class<T>>
Returns:
True if final, false otherwise
See Also:
WeldAnnotated.isFinal()

isPublic

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

Specified by:
isPublic in interface WeldAnnotated<T,java.lang.Class<T>>
Returns:
if public, returns true

getName

public java.lang.String getName()
Gets the name of the type

Specified by:
getName in interface WeldAnnotated<T,java.lang.Class<T>>
Returns:
The name
See Also:
WeldAnnotated.getName()

getWeldSuperclass

public WeldClass<?> getWeldSuperclass()
Gets the superclass abstraction of the type

Specified by:
getWeldSuperclass in interface WeldClass<T>
Returns:
The superclass abstraction

isEquivalent

public boolean isEquivalent(java.lang.Class<?> clazz)
Description copied from interface: WeldClass
Check if this is equivalent to a java class

Specified by:
isEquivalent in interface WeldClass<T>
Parameters:
clazz - The Java class
Returns:
true if equivalent

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in interface WeldAnnotated<T,java.lang.Class<T>>

isPackagePrivate

public boolean isPackagePrivate()
Specified by:
isPackagePrivate in interface WeldAnnotated<T,java.lang.Class<T>>

getPackage

public java.lang.Package getPackage()
Specified by:
getPackage in interface WeldAnnotated<T,java.lang.Class<T>>

asWeldSubclass

public <U> WeldClass<? extends U> asWeldSubclass(WeldClass<U> clazz)
Specified by:
asWeldSubclass in interface WeldClass<T>

cast

public <S> S cast(java.lang.Object object)
Specified by:
cast in interface WeldClass<T>

getConstructors

public java.util.Set<javax.enterprise.inject.spi.AnnotatedConstructor<T>> getConstructors()
Specified by:
getConstructors in interface javax.enterprise.inject.spi.AnnotatedType<T>

getFields

public java.util.Set<javax.enterprise.inject.spi.AnnotatedField<? super T>> getFields()
Specified by:
getFields in interface javax.enterprise.inject.spi.AnnotatedType<T>

getMethods

public java.util.Set<javax.enterprise.inject.spi.AnnotatedMethod<? super T>> getMethods()
Specified by:
getMethods in interface javax.enterprise.inject.spi.AnnotatedType<T>


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