org.jboss.webbeans.introspector
Interface AnnotatedClass<T>

All Superinterfaces:
AnnotatedItem<T,java.lang.Class<T>>, AnnotatedType<T>
All Known Implementing Classes:
AnnotatedClassImpl, ForwardingAnnotatedClass, WrappedAnnotatedClass

public interface AnnotatedClass<T>
extends AnnotatedType<T>

Represents a Class

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
MAPPED_METAANNOTATIONS
 
Method Summary
<U> AnnotatedClass<? extends U>
asSubclass(AnnotatedClass<U> clazz)
           
<S> S
cast(java.lang.Object object)
           
 java.util.Set<AnnotatedConstructor<T>> getAnnotatedConstructors(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all constructors which are annotated with annotationType
 java.util.Set<AnnotatedField<?>> getAnnotatedFields(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all fields which are annotated with the given annotation type on this class and all super classes
 java.util.Set<AnnotatedMethod<?>> getAnnotatedMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all methods annotated with annotationType
 java.util.Set<AnnotatedConstructor<T>> getConstructors()
          Gets all constructors
 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
 AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
          Get the constructor which matches the argument list provided
<F> AnnotatedField<F>
getDeclaredField(java.lang.String fieldName, AnnotatedClass<F> expectedType)
          Get a field by name
 AnnotatedMethod<?> getDeclaredMethod(java.lang.reflect.Method method)
          Deprecated. 
<M> AnnotatedMethod<M>
getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType)
          Get a method by name
 java.util.Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all with parameters annotated with annotationType
 java.util.Set<AnnotatedField<?>> getFields()
          Gets all fields on the type
 java.util.Set<AnnotatedField<?>> getMetaAnnotatedFields(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
          Gets all fields which are meta-annotated with metaAnnotationType
 AnnotatedMethod<?> getMethod(java.lang.reflect.Method method)
          Deprecated. 
 java.util.Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets all with parameters annotated with annotationType
 AnnotatedConstructor<T> getNoArgsConstructor()
          Gets the no-args constructor
 AnnotatedClass<?> getSuperclass()
          Gets the superclass.
 boolean isAbstract()
           
 boolean isEnum()
           
 boolean isNonStaticMemberClass()
          Determine if this is a non-static member class
 boolean isParameterizedType()
           
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedType
getSimpleName, isEquivalent
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
getActualTypeArguments, getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindings, getBindingsAsArray, getDeclaredMetaAnnotations, getFlattenedTypeHierarchy, getMetaAnnotations, getMetaAnnotationsAsArray, getName, getRawType, getType, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isFinal, isProxyable, isPublic, isStatic
 

Method Detail

getFields

java.util.Set<AnnotatedField<?>> getFields()
Gets all fields on the type

Returns:
A set of abstracted fields

getDeclaredField

<F> AnnotatedField<F> getDeclaredField(java.lang.String fieldName,
                                       AnnotatedClass<F> expectedType)
Get a field by name

Type Parameters:
F - the expected type of the field
Parameters:
fieldName - the field name
expectedType - the expected type of the field
Returns:
the field

getAnnotatedFields

java.util.Set<AnnotatedField<?>> getAnnotatedFields(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all fields which are annotated with the given annotation type on this class and all super classes

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

getDeclaredAnnotatedFields

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.

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

getMetaAnnotatedFields

java.util.Set<AnnotatedField<?>> getMetaAnnotatedFields(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Gets all fields which are meta-annotated with metaAnnotationType

Parameters:
metaAnnotationType - The meta annotation to match
Returns:
A set of abstracted fields with the given meta-annotation. Returns an empty set if there are no matches

getAnnotatedConstructors

java.util.Set<AnnotatedConstructor<T>> getAnnotatedConstructors(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all constructors which are annotated with annotationType

Parameters:
annotationType - The annotation type to match
Returns:
A set of abstracted fields with the given annotation. Returns an empty set if there are no matches

getConstructors

java.util.Set<AnnotatedConstructor<T>> getConstructors()
Gets all constructors

Returns:
A set of abstracted constructors

getNoArgsConstructor

AnnotatedConstructor<T> getNoArgsConstructor()
Gets the no-args constructor

Returns:
The no-args constructor, or null if not defined

getDeclaredConstructor

AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
Get the constructor which matches the argument list provided

Parameters:
parameterTypes - the parameters of the constructor
Returns:
the matching constructor, or null if not defined

getAnnotatedMethods

java.util.Set<AnnotatedMethod<?>> getAnnotatedMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all methods annotated with annotationType

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

getDeclaredAnnotatedMethods

java.util.Set<AnnotatedMethod<?>> getDeclaredAnnotatedMethods(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all methods annotated with annotationType

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

@Deprecated
AnnotatedMethod<?> getMethod(java.lang.reflect.Method method)
Deprecated. 

Find the annotated method for a given methodDescriptor

Parameters:
methodDescriptor -
Returns:
TODO Replace with AnnotatedMethod variant

getDeclaredMethod

<M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature,
                                         AnnotatedClass<M> expectedReturnType)
Get a method by name

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

getDeclaredMethod

@Deprecated
AnnotatedMethod<?> getDeclaredMethod(java.lang.reflect.Method method)
Deprecated. 


getMethodsWithAnnotatedParameters

java.util.Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all with parameters annotated with annotationType

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

java.util.Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all with parameters annotated with annotationType

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

getSuperclass

AnnotatedClass<?> getSuperclass()
Gets the superclass.

Specified by:
getSuperclass in interface AnnotatedType<T>
Returns:
The abstracted superclass, null if there is no superclass

isNonStaticMemberClass

boolean isNonStaticMemberClass()
Determine if this is a non-static member class

Returns:
true if this is a non-static member

isParameterizedType

boolean isParameterizedType()
Specified by:
isParameterizedType in interface AnnotatedItem<T,java.lang.Class<T>>

isAbstract

boolean isAbstract()

isEnum

boolean isEnum()

cast

<S> S cast(java.lang.Object object)

asSubclass

<U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz)


Copyright © 2011. All Rights Reserved.