Package gw.lang.reflect
Class ReflectUtil
- java.lang.Object
-
- gw.lang.reflect.ReflectUtil
-
public class ReflectUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ReflectUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
coerce(Object value, IType iType)
static Object[]
coerceArgsIfNecessary(IParameterInfo[] parameters, Object... args)
static <T> T
construct(String typeName, Object... args)
static IGosuObject
constructGosuClassInstance(String className, Object... args)
static IType[]
extractRuntimeTypes(Object... args)
static IMethodInfo
findCallableMethod(String methodName, IType[] runtimeTypes, IType type)
static IPropertyInfo
findProperty(IType type, String propertyName)
static IGosuClass
getClass(String fullyQualifiedName)
static IGosuClass
getClassButThrowIfInvalid(String fullyQualifiedName)
static IGosuObject
getEnclosingClassInstance(IGosuObject obj)
static Object
getProperty(Object instance, String propertyName)
static Object
getStaticProperty(IType type, String propertyName)
static Object
getStaticProperty(String className, String propertyName)
static Object
invokeMethod(Object instance, String methodName, Object... args)
static Object
invokeStaticMethod(String className, String methodName, Object... args)
static void
setProperty(Object instance, String propertyName, Object value)
static void
setStaticProperty(IType type, String propertyName, Object value)
static void
setStaticProperty(String className, String propertyName, Object value)
-
-
-
Method Detail
-
constructGosuClassInstance
public static IGosuObject constructGosuClassInstance(String className, Object... args)
-
invokeStaticMethod
public static Object invokeStaticMethod(String className, String methodName, Object... args)
-
setStaticProperty
public static void setStaticProperty(String className, String propertyName, Object value)
-
setStaticProperty
public static void setStaticProperty(IType type, String propertyName, Object value)
-
getClass
public static IGosuClass getClass(String fullyQualifiedName)
-
getClassButThrowIfInvalid
public static IGosuClass getClassButThrowIfInvalid(String fullyQualifiedName)
-
coerceArgsIfNecessary
public static Object[] coerceArgsIfNecessary(IParameterInfo[] parameters, Object... args)
-
findProperty
public static IPropertyInfo findProperty(IType type, String propertyName)
-
findCallableMethod
public static IMethodInfo findCallableMethod(String methodName, IType[] runtimeTypes, IType type)
-
getEnclosingClassInstance
public static IGosuObject getEnclosingClassInstance(IGosuObject obj)
-
-