de.ukn.hci.squidy.common.util
Class ReflectionUtil
java.lang.Object
de.ukn.hci.squidy.common.util.ReflectionUtil
public class ReflectionUtil
- extends Object
ReflectionUtil.
Date: Jun 25, 2008
Time: 1:32:47 PM
- Since:
- 1.0.0
- Version:
- $Id: ReflectionUtil.java 30 2009-09-18 22:23:35Z nitsche $
- Author:
- Roman Rädle, Roman.Raedle@uni-konstanz.de, University
of Konstanz
|
Method Summary |
static
|
callMethod(Method method,
Object invokable,
Object... parameters)
|
static Object |
callMethod(Object invokable,
String methodName,
Object... parameters)
|
static Object |
callMethod(Object invokable,
String methodName,
Object[] parameters,
Class[] parameterTypes)
|
static
|
createInstance(Class<T> type,
Object... parameters)
|
static
|
createInstance(String className)
|
static
|
getAnnotation(Class<A> annotationType,
Class<?> classType)
|
static Field |
getFieldInObjectHierarchy(Class<? extends Object> type,
String name)
|
static Field[] |
getFieldsInObjectHierarchy(Class<? extends Object> type)
|
static
|
loadClass(String className)
|
static Class<?>[] |
loadContextClasses(ClassLoader classLoader,
String[] classNames,
Class<?>... augmentClasses)
|
static void |
mapFieldsWithAnnotation(Class<? extends Annotation> annotationClass,
Object source,
Object target)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionUtil
public ReflectionUtil()
loadClass
public static <T> Class<T> loadClass(String className)
- Type Parameters:
T - - Parameters:
className -
- Returns:
createInstance
public static <T> T createInstance(String className)
- Type Parameters:
T - - Parameters:
className -
- Returns:
createInstance
public static <T> T createInstance(Class<T> type,
Object... parameters)
- Parameters:
type - parameters -
- Returns:
callMethod
public static <T> T callMethod(Method method,
Object invokable,
Object... parameters)
- Type Parameters:
T - - Parameters:
method - invokable - parameters -
- Returns:
callMethod
public static Object callMethod(Object invokable,
String methodName,
Object[] parameters,
Class[] parameterTypes)
- Parameters:
invokable - methodName - parameters - parameterTypes -
- Returns:
callMethod
public static Object callMethod(Object invokable,
String methodName,
Object... parameters)
- Parameters:
invokable - methodName - parameters -
- Returns:
getAnnotation
public static <A extends Annotation> A getAnnotation(Class<A> annotationType,
Class<?> classType)
- Parameters:
annotationType - classType -
- Returns:
getFieldInObjectHierarchy
public static Field getFieldInObjectHierarchy(Class<? extends Object> type,
String name)
- Parameters:
type - name -
- Returns:
getFieldsInObjectHierarchy
public static Field[] getFieldsInObjectHierarchy(Class<? extends Object> type)
- Parameters:
type -
- Returns:
loadContextClasses
public static Class<?>[] loadContextClasses(ClassLoader classLoader,
String[] classNames,
Class<?>... augmentClasses)
- Parameters:
classLoader - classNames - augmentClasses -
- Returns:
mapFieldsWithAnnotation
public static void mapFieldsWithAnnotation(Class<? extends Annotation> annotationClass,
Object source,
Object target)
- Parameters:
source - target -
Copyright © 2007-2010 Human-Computer-Interaction :: University of Konstanz. All Rights Reserved.