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