|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.runtime.MetaClassHelper
public class MetaClassHelper extends java.lang.Object
Field Summary | |
---|---|
static java.lang.Object[] |
ARRAY_WITH_NULL
|
static java.lang.Object[] |
EMPTY_ARRAY
|
static java.lang.Class[] |
EMPTY_CLASS_ARRAY
|
static java.lang.Class[] |
EMPTY_TYPE_ARRAY
|
protected static java.util.logging.Logger |
LOG
|
Method Summary | |
---|---|
static boolean
|
accessibleToConstructor(java.lang.Class at, java.lang.reflect.Constructor constructor)
|
static java.lang.Object
|
asPrimitiveArray(java.util.List list, java.lang.Class parameterType)
@param list the original list |
static java.lang.Object[]
|
asWrapperArray(java.lang.Object parameters, java.lang.Class componentType)
|
static long
|
calculateParameterDistance(java.lang.Class[] arguments, ParameterTypes pt)
|
static java.lang.String
|
capitalize(java.lang.String property)
In general we want to match the signature that allows us to use as less arguments for the vargs part as possible. |
static java.lang.Class[]
|
castArgumentsToClassArray(java.lang.Object[] argTypes)
|
static java.lang.Object
|
chooseEmptyMethodParams(FastArray methods)
|
static java.lang.Object
|
chooseMostGeneralMethodWith1NullParam(FastArray methods)
|
static boolean
|
containsMatchingMethod(java.util.List list, MetaMethod method)
|
static java.lang.Class[]
|
convertToTypeArray(java.lang.Object[] args)
|
static GroovyRuntimeException
|
createExceptionText(java.lang.String init, MetaMethod method, java.lang.Object object, java.lang.Object[] args, java.lang.Throwable reason, boolean setReason)
|
static void
|
doSetMetaClass(java.lang.Object self, MetaClass mc)
|
protected static java.lang.String
|
getClassName(java.lang.Object object)
|
static Closure
|
getMethodPointer(java.lang.Object object, java.lang.String methodName)
|
static boolean
|
isAssignableFrom(java.lang.Class classToTransformTo, java.lang.Class classToTransformFrom)
|
static boolean
|
isGenericSetMethod(MetaMethod method)
|
protected static boolean
|
isSuperclass(java.lang.Class clazz, java.lang.Class superclass)
|
static void
|
logMethodCall(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
|
static java.lang.Object
|
makeArray(java.lang.Object obj, java.lang.Class secondary, int length)
|
static java.lang.Object
|
makeCommonArray(java.lang.Object[] arguments, int offset, java.lang.Class fallback)
|
protected static java.lang.String
|
normalizedValue(java.lang.Object argument)
|
static boolean
|
parametersAreCompatible(java.lang.Class[] arguments, java.lang.Class[] parameters)
|
static boolean
|
sameClass(java.lang.Class[] params, java.lang.Object arg)
|
static boolean
|
sameClasses(java.lang.Class[] params, java.lang.Object[] arguments, boolean weakNullCheck)
|
static boolean
|
sameClasses(java.lang.Class[] params, java.lang.Object[] arguments)
|
static boolean
|
sameClasses(java.lang.Class[] params)
|
static boolean
|
sameClasses(java.lang.Class[] params, java.lang.Object arg1)
|
static boolean
|
sameClasses(java.lang.Class[] params, java.lang.Object arg1, java.lang.Object arg2)
|
static boolean
|
sameClasses(java.lang.Class[] params, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
|
static boolean
|
sameClasses(java.lang.Class[] params, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
Sets the meta class for an object, by delegating to the appropriate DefaultGroovyMethods helper method. |
protected static java.lang.String
|
shortName(java.lang.Object object)
|
static void
|
unwrap(java.lang.Object[] arguments)
|
static java.lang.Class[]
|
wrap(java.lang.Class[] classes)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final java.lang.Object[] ARRAY_WITH_NULL
public static final java.lang.Object[] EMPTY_ARRAY
public static final java.lang.Class[] EMPTY_CLASS_ARRAY
public static final java.lang.Class[] EMPTY_TYPE_ARRAY
protected static final java.util.logging.Logger LOG
Method Detail |
---|
public static boolean accessibleToConstructor(java.lang.Class at, java.lang.reflect.Constructor constructor)
public static java.lang.Object asPrimitiveArray(java.util.List list, java.lang.Class parameterType)
list
- the original listparameterType
- the resulting array type
public static java.lang.Object[] asWrapperArray(java.lang.Object parameters, java.lang.Class componentType)
public static long calculateParameterDistance(java.lang.Class[] arguments, ParameterTypes pt)
public static java.lang.String capitalize(java.lang.String property)
public static java.lang.Class[] castArgumentsToClassArray(java.lang.Object[] argTypes)
public static java.lang.Object chooseEmptyMethodParams(FastArray methods)
public static java.lang.Object chooseMostGeneralMethodWith1NullParam(FastArray methods)
public static boolean containsMatchingMethod(java.util.List list, MetaMethod method)
public static java.lang.Class[] convertToTypeArray(java.lang.Object[] args)
public static GroovyRuntimeException createExceptionText(java.lang.String init, MetaMethod method, java.lang.Object object, java.lang.Object[] args, java.lang.Throwable reason, boolean setReason)
public static void doSetMetaClass(java.lang.Object self, MetaClass mc)
protected static java.lang.String getClassName(java.lang.Object object)
public static Closure getMethodPointer(java.lang.Object object, java.lang.String methodName)
public static boolean isAssignableFrom(java.lang.Class classToTransformTo, java.lang.Class classToTransformFrom)
public static boolean isGenericSetMethod(MetaMethod method)
protected static boolean isSuperclass(java.lang.Class clazz, java.lang.Class superclass)
public static void logMethodCall(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
public static java.lang.Object makeArray(java.lang.Object obj, java.lang.Class secondary, int length)
public static java.lang.Object makeCommonArray(java.lang.Object[] arguments, int offset, java.lang.Class fallback)
protected static java.lang.String normalizedValue(java.lang.Object argument)
public static boolean parametersAreCompatible(java.lang.Class[] arguments, java.lang.Class[] parameters)
public static boolean sameClass(java.lang.Class[] params, java.lang.Object arg)
public static boolean sameClasses(java.lang.Class[] params, java.lang.Object[] arguments, boolean weakNullCheck)
public static boolean sameClasses(java.lang.Class[] params, java.lang.Object[] arguments)
public static boolean sameClasses(java.lang.Class[] params)
public static boolean sameClasses(java.lang.Class[] params, java.lang.Object arg1)
public static boolean sameClasses(java.lang.Class[] params, java.lang.Object arg1, java.lang.Object arg2)
public static boolean sameClasses(java.lang.Class[] params, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
public static boolean sameClasses(java.lang.Class[] params, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
self
- the object for which to set the meta classmc
- the metaclass
protected static java.lang.String shortName(java.lang.Object object)
public static void unwrap(java.lang.Object[] arguments)
public static java.lang.Class[] wrap(java.lang.Class[] classes)
Groovy Documentation