|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.InvokerHelper
A static helper class to make bytecode generation easier and act as a facade over the Invoker
Field Summary | |
static Object[] |
EMPTY_ARGS
|
Constructor Summary | |
InvokerHelper()
|
Method Summary | |
static boolean |
asBool(Object object)
|
static Collection |
asCollection(Object collection)
|
static int |
asInt(Object value)
|
static Iterator |
asIterator(Object collection)
|
static List |
asList(Object args)
|
static void |
assertFailed(Object expression,
Object message)
|
static Object |
asType(Object object,
Class type)
Provides a hook for type coercion of the given object to the required type |
static boolean |
booleanUnbox(Object value)
|
static Object |
box(boolean value)
|
static Object |
box(byte value)
|
static Object |
box(char value)
|
static Object |
box(double value)
|
static Object |
box(float value)
|
static Object |
box(int value)
|
static Object |
box(long value)
|
static Object |
box(short value)
|
static byte |
byteUnbox(Object value)
|
static char |
charUnbox(Object value)
|
static boolean |
compareEqual(Object left,
Object right)
|
static boolean |
compareGreaterThan(Object left,
Object right)
|
static boolean |
compareGreaterThanEqual(Object left,
Object right)
|
static boolean |
compareIdentical(Object left,
Object right)
|
static boolean |
compareLessThan(Object left,
Object right)
|
static boolean |
compareLessThanEqual(Object left,
Object right)
|
static boolean |
compareNotEqual(Object left,
Object right)
|
static Integer |
compareTo(Object left,
Object right)
|
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 double |
doubleUnbox(Object value)
|
static Matcher |
findRegex(Object left,
Object right)
|
static float |
floatUnbox(Object value)
|
static Object |
getGroovyObjectProperty(GroovyObject object,
String property)
|
static Invoker |
getInstance()
|
static MetaClass |
getMetaClass(Object object)
|
static Object |
getProperty(Object object,
String property)
|
static Object |
getPropertySafe(Object object,
String property)
|
static String |
getVersion()
|
static String |
inspect(Object self)
|
static int |
intUnbox(Object value)
|
static Object |
invokeClosure(Object closure,
Object arguments)
|
static Object |
invokeConstructor(String type,
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 |
invokeNoArgumentsMethod(Object object,
String methodName)
|
static Object |
invokeStaticMethod(String type,
String methodName,
Object arguments)
|
static Object |
invokeStaticNoArgumentsMethod(String type,
String methodName)
|
static Object |
invokeSuperMethod(Object object,
String methodName,
Object arguments)
|
static boolean |
isCase(Object switchValue,
Object caseExpression)
|
static long |
longUnbox(Object value)
|
static boolean |
matchRegex(Object left,
Object right)
|
static Object |
negate(Object value)
|
static boolean |
notBoolean(boolean bool)
|
static boolean |
notObject(Object object)
|
protected static List |
primitiveArrayToList(Object array)
Allows conversion of arrays into a mutable List |
static Pattern |
regexPattern(String regex)
|
static Object |
runScript(Class scriptClass,
String[] args)
|
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 short |
shortUnbox(Object value)
|
static String |
toString(Object arguments)
|
static String |
toTypeString(Object[] arguments)
|
static void |
write(Writer out,
Object object)
Writes the given object to the given stream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Object[] EMPTY_ARGS
Constructor Detail |
public InvokerHelper()
Method Detail |
public static MetaClass getMetaClass(Object object)
public static Invoker getInstance()
public static Object invokeNoArgumentsMethod(Object object, String methodName)
public static Object invokeMethod(Object object, String methodName, Object arguments)
public static Object invokeSuperMethod(Object object, String methodName, Object arguments)
public static Object invokeMethodSafe(Object object, String methodName, Object arguments)
public static Object invokeStaticMethod(String type, String methodName, Object arguments)
public static Object invokeStaticNoArgumentsMethod(String type, String methodName)
public static Object invokeConstructor(String type, Object arguments)
public static Object invokeConstructorOf(Class type, Object arguments)
public static Object invokeNoArgumentsConstructorOf(Class type)
public static Object invokeClosure(Object closure, Object arguments)
public static Iterator asIterator(Object collection)
public static Collection asCollection(Object collection)
public static List asList(Object args)
public static String toString(Object arguments)
public static String toTypeString(Object[] arguments)
public static String inspect(Object self)
public static Object getProperty(Object object, String property)
public static Object getPropertySafe(Object object, String property)
public static void setProperty(Object object, String property, Object newValue)
public static void setProperty2(Object newValue, Object object, String property)
public static void setGroovyObjectProperty(Object newValue, GroovyObject object, String property)
public static Object getGroovyObjectProperty(GroovyObject object, String property)
public static void setPropertySafe2(Object newValue, Object object, String property)
public static Object asType(Object object, Class type)
type
- of object to convert the given object toobject
- the object to be converted
public static boolean asBool(Object object)
public static boolean notObject(Object object)
public static boolean notBoolean(boolean bool)
public static Object negate(Object value)
public static boolean isCase(Object switchValue, Object caseExpression)
public static boolean compareIdentical(Object left, Object right)
public static boolean compareEqual(Object left, Object right)
public static Matcher findRegex(Object left, Object right)
public static boolean matchRegex(Object left, Object right)
public static Pattern regexPattern(String regex)
public static boolean compareNotEqual(Object left, Object right)
public static boolean compareLessThan(Object left, Object right)
public static boolean compareLessThanEqual(Object left, Object right)
public static boolean compareGreaterThan(Object left, Object right)
public static boolean compareGreaterThanEqual(Object left, Object right)
public static Integer compareTo(Object left, Object right)
public static Tuple createTuple(Object[] array)
public static List createList(Object[] values)
public static Map createMap(Object[] values)
public static List createRange(Object from, Object to, boolean inclusive)
public static int asInt(Object value)
public static void assertFailed(Object expression, Object message)
public static Object runScript(Class scriptClass, String[] args)
public static Script createScript(Class scriptClass, Binding context)
public static void setProperties(Object object, Map map)
object
- map
- public static String getVersion()
protected static List primitiveArrayToList(Object array)
public static void write(Writer out, Object object) throws IOException
IOException
public static Object box(boolean value)
public static Object box(byte value)
public static Object box(char value)
public static Object box(short value)
public static Object box(int value)
public static Object box(long value)
public static Object box(float value)
public static Object box(double value)
public static byte byteUnbox(Object value)
public static char charUnbox(Object value)
public static short shortUnbox(Object value)
public static int intUnbox(Object value)
public static boolean booleanUnbox(Object value)
public static long longUnbox(Object value)
public static float floatUnbox(Object value)
public static double doubleUnbox(Object value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |