|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.runtime.InvokerHelper
public class InvokerHelper extends Object
A static helper class to make bytecode generation easier and act as a facade over the Invoker
Field Summary | |
---|---|
static Object[] |
EMPTY_ARGS
|
protected static Object[] |
EMPTY_ARGUMENTS
|
protected static Class[] |
EMPTY_TYPES
|
static MetaClassRegistry |
metaRegistry
|
Method Summary | |
---|---|
static void
|
append(Appendable out, Object object)
Appends an object to an Appendable using Groovy's default representation for the object. |
static Object[]
|
asArray(Object arguments)
|
static Iterator
|
asIterator(Object o)
|
static List
|
asList(Object value)
|
static Object[]
|
asUnwrappedArray(Object arguments)
|
static void
|
assertFailed(Object expression, Object message)
|
static Object
|
bitwiseNegate(Object value)
|
static List
|
createList(Object[] values)
|
static Map
|
createMap(Object[] values)
|
static List
|
createRange(Object from, Object to, boolean inclusive)
|
static Script
|
createScript(Class scriptClass, Binding context)
|
static Tuple
|
createTuple(Object[] array)
|
static Matcher
|
findRegex(Object left, Object right)
Find the right hand regex within the left hand string and return a matcher. |
protected static String
|
format(Object arguments, boolean verbose)
|
static String
|
format(Object arguments, boolean verbose, int maxSize)
|
static Object
|
getAttribute(Object object, String attribute)
|
static Object
|
getGroovyObjectProperty(GroovyObject object, String property)
|
static MetaClass
|
getMetaClass(Object object)
|
static MetaClass
|
getMetaClass(Class cls)
|
static MetaClassRegistry
|
getMetaRegistry()
Invokes the given method on the object. |
static Closure
|
getMethodPointer(Object object, String methodName)
Returns the method pointer for the given object name |
static Object
|
getProperty(Object object, String property)
|
static Object
|
getPropertySafe(Object object, String property)
|
static String
|
inspect(Object self)
|
static Object
|
invokeClosure(Object closure, Object arguments)
|
static Object
|
invokeConstructorOf(String klass, Object arguments)
|
static Object
|
invokeConstructorOf(Class type, Object arguments)
|
static Object
|
invokeMethod(Object object, String methodName, Object arguments)
|
static Object
|
invokeMethodSafe(Object object, String methodName, Object arguments)
|
static Object
|
invokeNoArgumentsConstructorOf(Class type)
|
static Object
|
invokeStaticMethod(String klass, String methodName, Object arguments)
|
static Object
|
invokeStaticMethod(Class type, String method, Object arguments)
|
static Object
|
invokeStaticNoArgumentsMethod(Class type, String methodName)
|
static Object
|
invokeSuperMethod(Object object, String methodName, Object arguments)
Converts the given object into an array; if its an array then just cast otherwise wrap it in an array |
static boolean
|
matchRegex(Object left, Object right)
Find the right hand regex within the left hand string and return a matcher. |
static void
|
removeClass(Class clazz)
|
static Object
|
runScript(Class scriptClass, String[] args)
|
static void
|
setAttribute(Object object, String attribute, Object newValue)
|
static void
|
setGroovyObjectProperty(Object newValue, GroovyObject object, String property)
This is so we don't have to reorder the stack when we call this method. |
static void
|
setProperties(Object object, Map map)
Sets the properties on the given object |
static void
|
setProperty(Object object, String property, Object newValue)
|
static void
|
setProperty2(Object newValue, Object object, String property)
This is so we don't have to reorder the stack when we call this method. |
static void
|
setPropertySafe2(Object newValue, Object object, String property)
This is so we don't have to reorder the stack when we call this method. |
static SpreadMap
|
spreadMap(Object value)
|
static String
|
toArrayString(Object[] arguments)
|
static String
|
toArrayString(Object[] arguments, int maxSize, boolean safe)
|
static String
|
toListString(Collection arg)
|
static String
|
toListString(Collection arg, int maxSize)
|
static String
|
toListString(Collection arg, int maxSize, boolean safe)
|
static String
|
toMapString(Map arg)
A helper method to return the string representation of a map with bracket boundaries "[" and "]". |
static String
|
toMapString(Map arg, int maxSize)
|
static String
|
toString(Object arguments)
|
static String
|
toTypeString(Object[] arguments)
A helper method to format the arguments types as a comma-separated list. |
static Object
|
unaryMinus(Object value)
|
static Object
|
unaryPlus(Object value)
|
static void
|
write(Writer out, Object object)
Writes an object to a Writer using Groovy's default representation for the object. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
public static final Object[] EMPTY_ARGS
protected static final Object[] EMPTY_ARGUMENTS
protected static final Class[] EMPTY_TYPES
public static final MetaClassRegistry metaRegistry
Method Detail |
---|
public static void append(Appendable out, Object object)
public static Object[] asArray(Object arguments)
@SuppressWarningsfinal NullObject nullObject = NullObject.getNullObject(); public static Iterator asIterator(Object o)
public static List asList(Object value)
public static Object[] asUnwrappedArray(Object arguments)
public static void assertFailed(Object expression, Object message)
public static Object bitwiseNegate(Object value)
public static List createList(Object[] values)
public static Map createMap(Object[] values)
public static List createRange(Object from, Object to, boolean inclusive)
public static Script createScript(Class scriptClass, Binding context)
public static Tuple createTuple(Object[] array)
public static Matcher findRegex(Object left, Object right)
left
- string to compareright
- regular expression to compare the string to
protected static String format(Object arguments, boolean verbose)
public static String format(Object arguments, boolean verbose, int maxSize)
public static Object getAttribute(Object object, String attribute)
public static Object getGroovyObjectProperty(GroovyObject object, String property)
public static MetaClass getMetaClass(Object object)
public static MetaClass getMetaClass(Class cls)
public static MetaClassRegistry getMetaRegistry()
public static Closure getMethodPointer(Object object, String methodName)
public static Object getProperty(Object object, String property)
public static Object getPropertySafe(Object object, String property)
public static String inspect(Object self)
public static Object invokeClosure(Object closure, Object arguments)
public static Object invokeConstructorOf(String klass, Object arguments)
public static Object invokeConstructorOf(Class type, Object arguments)
public static Object invokeMethod(Object object, String methodName, Object arguments)
public static Object invokeMethodSafe(Object object, String methodName, Object arguments)
public static Object invokeNoArgumentsConstructorOf(Class type)
public static Object invokeStaticMethod(String klass, String methodName, Object arguments)
public static Object invokeStaticMethod(Class type, String method, Object arguments)
public static Object invokeStaticNoArgumentsMethod(Class type, String methodName)
public static Object invokeSuperMethod(Object object, String methodName, Object arguments)
public static boolean matchRegex(Object left, Object right)
left
- string to compareright
- regular expression to compare the string to
public static void removeClass(Class clazz)
public static Object runScript(Class scriptClass, String[] args)
public static void setAttribute(Object object, String attribute, Object newValue)
public static void setGroovyObjectProperty(Object newValue, GroovyObject object, String property)
public static void setProperties(Object object, Map map)
public static void setProperty(Object object, String property, Object newValue)
public static void setProperty2(Object newValue, Object object, String property)
public static void setPropertySafe2(Object newValue, Object object, String property)
public static SpreadMap spreadMap(Object value)
public static String toArrayString(Object[] arguments)
public static String toArrayString(Object[] arguments, int maxSize, boolean safe)
public static String toListString(Collection arg)
public static String toListString(Collection arg, int maxSize)
public static String toListString(Collection arg, int maxSize, boolean safe)
public static String toMapString(Map arg)
arg
- the map to processmaxSize
- stop after approximately this many characters and append '...'
public static String toMapString(Map arg, int maxSize)
public static String toString(Object arguments)
public static String toTypeString(Object[] arguments)
arguments
- the type to process
public static Object unaryMinus(Object value)
public static Object unaryPlus(Object value)
public static void write(Writer out, Object object)
Copyright © 2003-2013 The Codehaus. All rights reserved.