org.jboss.seam.util
Class Reflections

java.lang.Object
  extended by org.jboss.seam.util.Reflections
Direct Known Subclasses:
Interceptor

public class Reflections
extends java.lang.Object


Constructor Summary
Reflections()
           
 
Method Summary
static java.lang.Class classForName(java.lang.String name)
           
static java.lang.Object get(java.lang.reflect.Field field, java.lang.Object target)
           
static java.lang.Object getAndWrap(java.lang.reflect.Field field, java.lang.Object target)
           
static java.lang.Class getCollectionElementType(java.lang.reflect.Type collectionType)
           
static java.lang.reflect.Field getField(java.lang.Class clazz, java.lang.String name)
           
static java.util.List<java.lang.reflect.Field> getFields(java.lang.Class clazz, java.lang.Class annotation)
          Get all the fields which are annotated with the given annotation.
static java.lang.reflect.Method getGetterMethod(java.lang.Class clazz, java.lang.String name)
           
static java.util.List<java.lang.reflect.Method> getGetterMethods(java.lang.Class clazz, java.lang.Class annotation)
          Get all the getter methods annotated with the given annotation.
static java.lang.Class getMapKeyType(java.lang.reflect.Type collectionType)
           
static java.lang.reflect.Method getMethod(java.lang.annotation.Annotation annotation, java.lang.String name)
           
static java.lang.reflect.Method getMethod(java.lang.Class clazz, java.lang.String name)
           
static java.lang.reflect.Method getSetterMethod(java.lang.Class clazz, java.lang.String name)
           
static java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object target, java.lang.Object... args)
           
static java.lang.Object invokeAndWrap(java.lang.reflect.Method method, java.lang.Object target, java.lang.Object... args)
           
static boolean isClassAvailable(java.lang.String name)
          Return's true if the class can be loaded using Reflections.classForName()
static boolean isInstanceOf(java.lang.Class clazz, java.lang.String name)
          Check to see if clazz is an instance of name
static void set(java.lang.reflect.Field field, java.lang.Object target, java.lang.Object value)
           
static void setAndWrap(java.lang.reflect.Field field, java.lang.Object target, java.lang.Object value)
           
static java.lang.String toString(java.lang.reflect.Member member)
           
static java.lang.String toString(java.lang.reflect.Method method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reflections

public Reflections()
Method Detail

invoke

public static java.lang.Object invoke(java.lang.reflect.Method method,
                                      java.lang.Object target,
                                      java.lang.Object... args)
                               throws java.lang.Exception
Throws:
java.lang.Exception

get

public static java.lang.Object get(java.lang.reflect.Field field,
                                   java.lang.Object target)
                            throws java.lang.Exception
Throws:
java.lang.Exception

set

public static void set(java.lang.reflect.Field field,
                       java.lang.Object target,
                       java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

getAndWrap

public static java.lang.Object getAndWrap(java.lang.reflect.Field field,
                                          java.lang.Object target)

setAndWrap

public static void setAndWrap(java.lang.reflect.Field field,
                              java.lang.Object target,
                              java.lang.Object value)

invokeAndWrap

public static java.lang.Object invokeAndWrap(java.lang.reflect.Method method,
                                             java.lang.Object target,
                                             java.lang.Object... args)

toString

public static java.lang.String toString(java.lang.reflect.Method method)

toString

public static java.lang.String toString(java.lang.reflect.Member member)

classForName

public static java.lang.Class classForName(java.lang.String name)
                                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

isClassAvailable

public static boolean isClassAvailable(java.lang.String name)
Return's true if the class can be loaded using Reflections.classForName()


getCollectionElementType

public static java.lang.Class getCollectionElementType(java.lang.reflect.Type collectionType)

getMapKeyType

public static java.lang.Class getMapKeyType(java.lang.reflect.Type collectionType)

getSetterMethod

public static java.lang.reflect.Method getSetterMethod(java.lang.Class clazz,
                                                       java.lang.String name)

getGetterMethod

public static java.lang.reflect.Method getGetterMethod(java.lang.Class clazz,
                                                       java.lang.String name)

getGetterMethods

public static java.util.List<java.lang.reflect.Method> getGetterMethods(java.lang.Class clazz,
                                                                        java.lang.Class annotation)
Get all the getter methods annotated with the given annotation. Returns an empty list if none are found


getField

public static java.lang.reflect.Field getField(java.lang.Class clazz,
                                               java.lang.String name)

getFields

public static java.util.List<java.lang.reflect.Field> getFields(java.lang.Class clazz,
                                                                java.lang.Class annotation)
Get all the fields which are annotated with the given annotation. Returns an empty list if none are found


getMethod

public static java.lang.reflect.Method getMethod(java.lang.annotation.Annotation annotation,
                                                 java.lang.String name)

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class clazz,
                                                 java.lang.String name)

isInstanceOf

public static boolean isInstanceOf(java.lang.Class clazz,
                                   java.lang.String name)
Check to see if clazz is an instance of name



Copyright © 2011 Seam Framework. All Rights Reserved.