| java.lang.Object org.jicengine.operation.ReflectionUtils
All known Subclasses: org.jicengine.operation.BeanUtils,
ReflectionUtils | public class ReflectionUtils (Code) | |
Copyright (C) 2004 Timo Laitinen
author: .timo version: 1.0 |
Method Summary | |
protected static Class | getActorClass(Object instanceOrClass) | protected static String | getArgumentTypeList(Object[] arguments) | public static Object | getFieldValue(Object instance, Class ownerClass, String fieldName) Parameters: instance - the instance whose field is referenced. | protected static Class[] | getTypes(Object[] parameters) | public static Object | instantiate(Class instantiatedClass, Object[] arguments) | public static Object | invokeMethod(Object actor, String methodName, Object[] arguments) Invokes a method.
Parameters: methodName - the name of the method, like'addLayer' or 'setName' Parameters: actor - Description of the Parameter Parameters: arguments - Description of the Parameter an Object, if the invoked methodreturned something. | public static Object | invokeStaticMethod(Class actorClass, String methodName, Object[] arguments) | public static boolean | isAssignableFrom(Class class1, Class class2)
Mimics method Class.isAssignableFrom , but handles the
conversions between primitives and primitive wrappers automatically. | protected static Class | primitiveTypeToWrapperType(Class primitiveType) | protected static Class | primitiveWrapperToPrimitiveType(Class objectClass) | public static void | setFieldValue(Object instance, Class ownerClass, String fieldName, Object fieldValue) |
getArgumentTypeList | protected static String getArgumentTypeList(Object[] arguments)(Code) | | Parameters: arguments - Object[] String types in format [arg1 class], [arg2 class], etc. |
getFieldValue | public static Object getFieldValue(Object instance, Class ownerClass, String fieldName) throws Exception(Code) | | Parameters: instance - the instance whose field is referenced. may be null, ifthe field in question is a static field. Parameters: ownerClass - the class that 'owns' the field. Parameters: fieldName - the name of the field. |
isAssignableFrom | public static boolean isAssignableFrom(Class class1, Class class2)(Code) | |
Mimics method Class.isAssignableFrom , but handles the
conversions between primitives and primitive wrappers automatically.
Parameters: class1 - Class Parameters: class2 - Class boolean |
primitiveTypeToWrapperType | protected static Class primitiveTypeToWrapperType(Class primitiveType)(Code) | | Parameters: primitiveType - Description of the Parameter null if the argument class is not a primitive type. |
primitiveWrapperToPrimitiveType | protected static Class primitiveWrapperToPrimitiveType(Class objectClass)(Code) | | Parameters: objectClass - Description of the Parameter the Class representing a primitive: if the argumentClass is java.lang.Integer, returns Integer.TYPe, etc.null if the argument class is not a wrapper. |
|
|