| java.lang.Object org.codehaus.groovy.runtime.MetaClassHelper
MetaClassHelper | public class MetaClassHelper (Code) | | author: John Wilson author: Jochen Theodorou |
Method Summary | |
public static boolean | accessibleToConstructor(Class at, Constructor constructor) | public static Object | asPrimitiveArray(List list, Class parameterType) | public static Object[] | asWrapperArray(Object parameters, Class componentType) | protected static Class | autoboxType(Class type) | public static long | calculateParameterDistance(Class[] arguments, Class[] parameters) | public static String | capitalize(String property) | public static Object | chooseEmptyMethodParams(List methods) the method with 1 parameter which takes the most general type ofobject (e.g. | public static Object | chooseMostGeneralMethodWith1NullParam(List methods) the method with 1 parameter which takes the most general type ofobject (e.g. | public static Object[] | coerceArgumentsToClasses(Object[] argumentArray, Class[] paramTypes) | protected static Object | coerceArray(Object argument, Class param) | protected static Object | coerceGString(Object argument, Class clazz) | protected static Object | coerceNumber(Object argument, Class param) | public static boolean | containsMatchingMethod(List list, MetaMethod method) | public static Class[] | convertToTypeArray(Object[] args) | public static Object | createListenerProxy(Class listenerType, String listenerMethodName, Closure closure) | public static Object | doConstructorInvoke(Constructor constructor, Object[] argumentArray) | public static Object | doMethodInvoke(Object object, MetaMethod method, Object[] argumentArray) | protected static String | getClassName(Object object) | public static Closure | getMethodPointer(Object object, String methodName) Returns a callable object for the given method name on the object. | public static Class[] | getParameterTypes(Object methodOrConstructor) | public static boolean | isAssignableFrom(Class classToTransformTo, Class classToTransformFrom) | public static boolean | isGenericSetMethod(MetaMethod method) | protected static boolean | isSuperclass(Class claszz, Class superclass) | public static boolean | isValidMethod(Class[] paramTypes, Class[] arguments, boolean includeCoerce) | public static boolean | isValidMethod(Object method, Class[] arguments, boolean includeCoerce) | public static boolean | isVargsMethod(Class[] paramTypes, Object[] arguments) | public static void | logMethodCall(Object object, String methodName, Object[] arguments) | protected static String | normalizedValue(Object argument) | public static boolean | parametersAreCompatible(Class[] arguments, Class[] parameters) | protected static String | shortName(Object object) | public static Class[] | wrap(Class[] classes) |
ARRAY_WITH_NULL | final protected static Object[] ARRAY_WITH_NULL(Code) | | |
EMPTY_TYPE_ARRAY | public static Class[] EMPTY_TYPE_ARRAY(Code) | | |
asPrimitiveArray | public static Object asPrimitiveArray(List list, Class parameterType)(Code) | | Parameters: list - Parameters: parameterType - |
calculateParameterDistance | public static long calculateParameterDistance(Class[] arguments, Class[] parameters)(Code) | | |
chooseEmptyMethodParams | public static Object chooseEmptyMethodParams(List methods)(Code) | | the method with 1 parameter which takes the most general type ofobject (e.g. Object) |
chooseMostGeneralMethodWith1NullParam | public static Object chooseMostGeneralMethodWith1NullParam(List methods)(Code) | | the method with 1 parameter which takes the most general type ofobject (e.g. Object) ignoring primitve types |
coerceArgumentsToClasses | public static Object[] coerceArgumentsToClasses(Object[] argumentArray, Class[] paramTypes)(Code) | | |
coerceGString | protected static Object coerceGString(Object argument, Class clazz)(Code) | | Coerces a GString instance into String if needed
the coerced argument |
containsMatchingMethod | public static boolean containsMatchingMethod(List list, MetaMethod method)(Code) | | true if a method of the same matching prototype was found in thelist |
convertToTypeArray | public static Class[] convertToTypeArray(Object[] args)(Code) | | param instance array to the type array
Parameters: args - |
createListenerProxy | public static Object createListenerProxy(Class listenerType, String listenerMethodName, Closure closure)(Code) | | Parameters: listenerType - the interface of the listener to proxy Parameters: listenerMethodName - the name of the method in the listener API to call theclosure on Parameters: closure - the closure to invoke on the listenerMethodName methodinvocation a dynamic proxy which calls the given closure on the givenmethod name |
getMethodPointer | public static Closure getMethodPointer(Object object, String methodName)(Code) | | Returns a callable object for the given method name on the object.
The object acts like a Closure in that it can be called, like a closure
and passed around - though really its a method pointer, not a closure per se.
|
getParameterTypes | public static Class[] getParameterTypes(Object methodOrConstructor)(Code) | | |
isAssignableFrom | public static boolean isAssignableFrom(Class classToTransformTo, Class classToTransformFrom)(Code) | | |
isGenericSetMethod | public static boolean isGenericSetMethod(MetaMethod method)(Code) | | |
isSuperclass | protected static boolean isSuperclass(Class claszz, Class superclass)(Code) | | |
isValidMethod | public static boolean isValidMethod(Class[] paramTypes, Class[] arguments, boolean includeCoerce)(Code) | | |
isValidMethod | public static boolean isValidMethod(Object method, Class[] arguments, boolean includeCoerce)(Code) | | |
isVargsMethod | public static boolean isVargsMethod(Class[] paramTypes, Object[] arguments)(Code) | | |
parametersAreCompatible | public static boolean parametersAreCompatible(Class[] arguments, Class[] parameters)(Code) | | |
|
|