org.jboss.webbeans.introspector.jlr
Class AnnotatedClassImpl<T>

java.lang.Object
  extended by org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem<T,java.lang.Class<T>>
      extended by org.jboss.webbeans.introspector.jlr.AbstractAnnotatedType<T>
          extended by org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl<T>
Type Parameters:
T -
All Implemented Interfaces:
AnnotatedClass<T>, AnnotatedItem<T,java.lang.Class<T>>, AnnotatedType<T>

public class AnnotatedClassImpl<T>
extends AbstractAnnotatedType<T>
implements AnnotatedClass<T>

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

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
MAPPED_METAANNOTATIONS
 
Method Summary
 java.lang.reflect.Type[] getActualTypeArguments()
          Gets the actual type arguments
 java.lang.Class<? extends T> getAnnotatedClass()
          Gets the implementing class
 java.util.Set<AnnotatedConstructor<T>> getAnnotatedConstructors(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets constructors with given annotation type
 java.util.Set<AnnotatedField<?>> getAnnotatedFields(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<AnnotatedMethod<?>> getAnnotatedMethods(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
 AnnotatedConstructor<T> getConstructor(java.util.List<java.lang.Class<?>> arguments)
          Gets a constructor with given arguments
 java.util.Set<AnnotatedConstructor<T>> getConstructors()
          Gets the abstracted constructors of the class Initializes the constructors if they are null
 java.util.Set<AnnotatedField<?>> getDeclaredAnnotatedFields(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<AnnotatedMethod<?>> getDeclaredAnnotatedMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all methods annotated with annotationType
 java.util.Set<AnnotatedField<?>> getDeclaredFields()
           
 AnnotatedMethod<?> getDeclaredMethod(java.lang.reflect.Method method)
           
 java.util.Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(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<AnnotatedField<?>> getFields()
          Gets the abstracted fields of the class Initializes the fields if they are null
 java.util.Set<AnnotatedField<?>> getMetaAnnotatedFields(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.
 AnnotatedMethod<?> getMethod(java.lang.reflect.Method methodDescriptor)
          Find the annotated method for a given methodDescriptor
 java.util.Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all with parameters annotated with annotationType
 java.lang.Class<T> getType()
          Gets the type of the class
 boolean isNonStaticMemberClass()
          Determine if this is a non-static member class
 boolean isParameterizedType()
           
static
<T> AnnotatedClass<T>
of(java.lang.Class<T> clazz)
           
static
<T> AnnotatedClassImpl<T>
of(java.lang.Class<T> clazz, java.lang.annotation.Annotation[] annotations)
          Deprecated. 
static
<T> AnnotatedClassImpl<T>
of(TypeLiteral<T> typeLiteral, java.lang.annotation.Annotation[] annotations)
          Deprecated. 
 java.lang.String toString()
          Gets a string representation of the class
 AnnotatedClass<T> wrap(java.util.Set<java.lang.annotation.Annotation> annotations)
           
 
Methods inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedType
getName, getSimpleName, getSuperclass, isEquivalent, isFinal, isPublic, isStatic
 
Methods inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem
equals, getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindingTypes, getBindingTypesAsArray, getDeclaredMetaAnnotations, getMetaAnnotations, getMetaAnnotationsAsArray, hashCode, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isProxyable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedClass
getSuperclass
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedType
getSimpleName, isEquivalent
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindingTypes, getBindingTypesAsArray, getDeclaredMetaAnnotations, getMetaAnnotations, getMetaAnnotationsAsArray, getName, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isFinal, isProxyable, isPublic, isStatic
 

Method Detail

of

public static <T> AnnotatedClass<T> of(java.lang.Class<T> clazz)

of

@Deprecated
public static <T> AnnotatedClassImpl<T> of(TypeLiteral<T> typeLiteral,
                                                      java.lang.annotation.Annotation[] annotations)
Deprecated. 


of

@Deprecated
public static <T> AnnotatedClassImpl<T> of(java.lang.Class<T> clazz,
                                                      java.lang.annotation.Annotation[] annotations)
Deprecated. 


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 AbstractAnnotatedItem<T,java.lang.Class<T>>
Returns:
The class

getFields

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

Specified by:
getFields in interface AnnotatedClass<T>
Returns:
The set of abstracted fields

getDeclaredFields

public java.util.Set<AnnotatedField<?>> getDeclaredFields()

getDeclaredAnnotatedFields

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

Specified by:
getDeclaredAnnotatedFields in interface AnnotatedClass<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

getConstructors

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

Specified by:
getConstructors in interface AnnotatedClass<T>
Returns:
The set of abstracted constructors

getMetaAnnotatedFields

public java.util.Set<AnnotatedField<?>> getMetaAnnotatedFields(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:
getMetaAnnotatedFields in interface AnnotatedClass<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.

getAnnotatedFields

public java.util.Set<AnnotatedField<?>> getAnnotatedFields(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:
getAnnotatedFields in interface AnnotatedClass<T>
Parameters:
annotationType - The annotation type to match
Returns:
A set of matching abstracted fields, null if none are found.

getType

public java.lang.Class<T> getType()
Gets the type of the class

Specified by:
getType in interface AnnotatedItem<T,java.lang.Class<T>>
Returns:
The type

isNonStaticMemberClass

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

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

isParameterizedType

public boolean isParameterizedType()
Specified by:
isParameterizedType in interface AnnotatedClass<T>

getActualTypeArguments

public java.lang.reflect.Type[] getActualTypeArguments()
Gets the actual type arguments

Specified by:
getActualTypeArguments in interface AnnotatedItem<T,java.lang.Class<T>>
Returns:
The type arguments
See Also:
AnnotatedItem.getActualTypeArguments()

getAnnotatedMethods

public java.util.Set<AnnotatedMethod<?>> getAnnotatedMethods(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:
getAnnotatedMethods in interface AnnotatedClass<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:
AnnotatedClass.getAnnotatedMethods(Class)

getDeclaredAnnotatedMethods

public java.util.Set<AnnotatedMethod<?>> getDeclaredAnnotatedMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: AnnotatedClass
Gets all methods annotated with annotationType

Specified by:
getDeclaredAnnotatedMethods in interface AnnotatedClass<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

getAnnotatedConstructors

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

Specified by:
getAnnotatedConstructors in interface AnnotatedClass<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:
AnnotatedClass.getAnnotatedConstructors(Class)

getConstructor

public AnnotatedConstructor<T> getConstructor(java.util.List<java.lang.Class<?>> arguments)
Gets a constructor with given arguments

Specified by:
getConstructor in interface AnnotatedClass<T>
Parameters:
arguments - The arguments to match
Returns:
A constructor which takes given arguments. Null is returned if there are no matches.
See Also:
AnnotatedClass.getConstructor(List)

getMethodsWithAnnotatedParameters

public java.util.Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: AnnotatedClass
Gets all with parameters annotated with annotationType

Specified by:
getMethodsWithAnnotatedParameters in interface AnnotatedClass<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

getDeclaredMethodsWithAnnotatedParameters

public java.util.Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: AnnotatedClass
Gets all with parameters annotated with annotationType

Specified by:
getDeclaredMethodsWithAnnotatedParameters in interface AnnotatedClass<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

getMethod

public AnnotatedMethod<?> getMethod(java.lang.reflect.Method methodDescriptor)
Description copied from interface: AnnotatedClass
Find the annotated method for a given methodDescriptor

Specified by:
getMethod in interface AnnotatedClass<T>
Returns:

getDeclaredMethod

public AnnotatedMethod<?> getDeclaredMethod(java.lang.reflect.Method method)
Specified by:
getDeclaredMethod in interface AnnotatedClass<T>

toString

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

Overrides:
toString in class AbstractAnnotatedType<T>
Returns:
A string representation

wrap

public AnnotatedClass<T> wrap(java.util.Set<java.lang.annotation.Annotation> annotations)


Copyright © 2008-2009. All Rights Reserved.