Overview | Package | Class
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.runtime
Class ScriptBytecodeAdapter

A static helper class to interface bytecode and runtime

author:
  Jochen Theodorou

version:
  $Revision: 13371 $

Field Summary
`def` | `EMPTY_ARGS`
`Integer` | `MINUS_ONE`
`Integer` | `ONE`
`Integer` | `ZERO`

Constructor Summary
`ScriptBytecodeAdapter()`

Method Summary
`static Object` | `asType(Object object, Class type)` Provides a hook for type coercion of the given object to the required type
`static void` | `assertFailed(Object expression, Object message)`
`static Object` | `bitwiseNegate(Object value)`
`static Object` | `castToType(Object object, Class type)` Provides a hook for type casting of the given object to the required type
`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 Wrapper` | `createGroovyObjectWrapper(GroovyObject val, Class clazz)`
`static List` | `createList(def values)`
`static Map` | `createMap(def values)`
`static Wrapper` | `createPojoWrapper(Object val, Class clazz)`
`static List` | `createRange(Object from, Object to, boolean inclusive)`
`static Tuple` | `createTuple(def array)`
`static def` | `despreadList(def args, def spreads, def positions)`
`static Matcher` | `findRegex(Object left, Object right)`
`static def` | `getBoxedItems(Object receiver)`
`static Object` | `getField(Class senderClass, Object receiver, String messageName)`
`static Object` | `getFieldOnSuper(Class senderClass, Object receiver, String messageName)`
`static Object` | `getFieldOnSuperSafe(Class senderClass, Object receiver, String messageName)`
`static Object` | `getFieldOnSuperSpreadSafe(Class senderClass, Object receiver, String messageName)`
`static Object` | `getFieldSafe(Class senderClass, Object receiver, String messageName)`
`static Object` | `getFieldSpreadSafe(Class senderClass, Object receiver, String messageName)`
`static Object` | `getGroovyObjectField(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getGroovyObjectFieldSafe(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getGroovyObjectFieldSpreadSafe(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getGroovyObjectProperty(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getGroovyObjectPropertySafe(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getGroovyObjectPropertySpreadSafe(Class senderClass, GroovyObject receiver, String messageName)`
`static Closure` | `getMethodPointer(Object object, String methodName)` Returns the method pointer for the given object name
`static Object` | `getProperty(Class senderClass, Object receiver, String messageName)`
`static Object` | `getPropertyOnSuper(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getPropertyOnSuperSafe(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getPropertyOnSuperSpreadSafe(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `getPropertySafe(Class senderClass, Object receiver, String messageName)`
`static Object` | `getPropertySpreadSafe(Class senderClass, Object receiver, String messageName)`
`static MetaClass` | `initMetaClass(Object object)`
`static Object` | `invokeClosure(Object closure, def arguments)`
`static Object` | `invokeMethod0(Class senderClass, Object receiver, String messageName)`
`static Object` | `invokeMethod0Safe(Class senderClass, Object receiver, String messageName)`
`static Object` | `invokeMethod0SpreadSafe(Class senderClass, Object receiver, String messageName)`
`static Object` | `invokeMethodN(Class senderClass, Object receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodNSafe(Class senderClass, Object receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodNSpreadSafe(Class senderClass, Object receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnCurrent0(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `invokeMethodOnCurrent0Safe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnCurrent0SpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnCurrentN(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnCurrentNSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnCurrentNSpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnSuper0(Class senderClass, GroovyObject receiver, String messageName)`
`static Object` | `invokeMethodOnSuper0Safe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnSuper0SpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnSuperN(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnSuperNSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeMethodOnSuperNSpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)`
`static Object` | `invokeNew0(Class senderClass, Class receiver)`
`static Object` | `invokeNewN(Class senderClass, Class receiver, Object arguments)`
`static Object` | `invokeStaticMethod0(Class senderClass, Class receiver, String messageName)`
`static Object` | `invokeStaticMethodN(Class senderClass, Class receiver, String messageName, def messageArguments)`
`static boolean` | `isCase(Object switchValue, Object caseExpression)`
`static boolean` | `isSpreadable(Object receiver)`
`static boolean` | `matchRegex(Object left, Object right)`
`static Pattern` | `regexPattern(Object regex)`
`static int` | `selectConstructorAndTransformArguments(def arguments, int numberOfConstructors, Class which)`
`static void` | `setField(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setFieldOnSuper(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setFieldOnSuperSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setFieldOnSuperSpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setFieldSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setFieldSpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setGroovyObjectField(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setGroovyObjectFieldSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setGroovyObjectFieldSpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setGroovyObjectProperty(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setGroovyObjectPropertySafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setGroovyObjectPropertySpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setProperty(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setPropertyOnSuper(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setPropertyOnSuperSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setPropertyOnSuperSpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)`
`static void` | `setPropertySafe(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static void` | `setPropertySpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)`
`static Object` | `spreadMap(Object value)`
`static Object` | `unaryMinus(Object value)`
`static Object` | `unaryPlus(Object value)`
`static Throwable` | `unwrap(GroovyRuntimeException gre)`

Constructor Detail

### ScriptBytecodeAdapter

    ScriptBytecodeAdapter()

Method Detail

### asType

    public static Object asType(Object object, Class type)

  Provides a hook for type coercion of the given object to the required type
  param:
    type of object to convert the given object to
  param:
    object the object to be converted
  return:
    the original object or a new converted value
  throws:
    Throwable if the coercion fails

### assertFailed

    public static void assertFailed(Object expression, Object message)

### bitwiseNegate

    public static Object bitwiseNegate(Object value)

### castToType

    public static Object castToType(Object object, Class type)

  Provides a hook for type casting of the given object to the required type
  param:
    type of object to convert the given object to
  param:
    object the object to be converted
  return:
    the original object or a new converted value
  throws:
    Throwable if the type casting fails

### compareEqual

    public static boolean compareEqual(Object left, Object right)

### compareGreaterThan

    public static boolean compareGreaterThan(Object left, Object right)

### compareGreaterThanEqual

    public static boolean compareGreaterThanEqual(Object left, Object right)

### compareIdentical

    public static boolean compareIdentical(Object left, Object right)

### compareLessThan

    public static boolean compareLessThan(Object left, Object right)

### compareLessThanEqual

    public static boolean compareLessThanEqual(Object left, Object right)

### compareNotEqual

    public static boolean compareNotEqual(Object left, Object right)

### compareTo

    public static Integer compareTo(Object left, Object right)

### createGroovyObjectWrapper

    public static Wrapper createGroovyObjectWrapper(GroovyObject val, Class clazz)

### createList

    public static List createList(def values)

### createMap

    public static Map createMap(def values)

### createPojoWrapper

    public static Wrapper createPojoWrapper(Object val, Class clazz)

### createRange

    public static List createRange(Object from, Object to, boolean inclusive)

### createTuple

    public static Tuple createTuple(def array)

### despreadList

    public static def despreadList(def args, def spreads, def positions)

### findRegex

    public static Matcher findRegex(Object left, Object right)

### getBoxedItems

    static def getBoxedItems(Object receiver)

### getField

    public static Object getField(Class senderClass, Object receiver, String messageName)

### getFieldOnSuper

    public static Object getFieldOnSuper(Class senderClass, Object receiver, String messageName)

### getFieldOnSuperSafe

    public static Object getFieldOnSuperSafe(Class senderClass, Object receiver, String messageName)

### getFieldOnSuperSpreadSafe

    public static Object getFieldOnSuperSpreadSafe(Class senderClass, Object receiver, String messageName)

### getFieldSafe

    public static Object getFieldSafe(Class senderClass, Object receiver, String messageName)

### getFieldSpreadSafe

    public static Object getFieldSpreadSafe(Class senderClass, Object receiver, String messageName)

### getGroovyObjectField

    public static Object getGroovyObjectField(Class senderClass, GroovyObject receiver, String messageName)

### getGroovyObjectFieldSafe

    public static Object getGroovyObjectFieldSafe(Class senderClass, GroovyObject receiver, String messageName)

### getGroovyObjectFieldSpreadSafe

    public static Object getGroovyObjectFieldSpreadSafe(Class senderClass, GroovyObject receiver, String messageName)

### getGroovyObjectProperty

    public static Object getGroovyObjectProperty(Class senderClass, GroovyObject receiver, String messageName)

### getGroovyObjectPropertySafe

    public static Object getGroovyObjectPropertySafe(Class senderClass, GroovyObject receiver, String messageName)

### getGroovyObjectPropertySpreadSafe

    public static Object getGroovyObjectPropertySpreadSafe(Class senderClass, GroovyObject receiver, String messageName)

### getMethodPointer

    public static Closure getMethodPointer(Object object, String methodName)

  Returns the method pointer for the given object name
  param:
    object the object containing the method
  param:
    methodName the name of the method of interest
  return:
    the resulting Closure

### getProperty

    public static Object getProperty(Class senderClass, Object receiver, String messageName)

### getPropertyOnSuper

    public static Object getPropertyOnSuper(Class senderClass, GroovyObject receiver, String messageName)

### getPropertyOnSuperSafe

    public static Object getPropertyOnSuperSafe(Class senderClass, GroovyObject receiver, String messageName)

### getPropertyOnSuperSpreadSafe

    public static Object getPropertyOnSuperSpreadSafe(Class senderClass, GroovyObject receiver, String messageName)

### getPropertySafe

    public static Object getPropertySafe(Class senderClass, Object receiver, String messageName)

### getPropertySpreadSafe

    public static Object getPropertySpreadSafe(Class senderClass, Object receiver, String messageName)

### initMetaClass

    public static MetaClass initMetaClass(Object object)

### invokeClosure

    public static Object invokeClosure(Object closure, def arguments)

### invokeMethod0

    public static Object invokeMethod0(Class senderClass, Object receiver, String messageName)

### invokeMethod0Safe

    public static Object invokeMethod0Safe(Class senderClass, Object receiver, String messageName)

### invokeMethod0SpreadSafe

    public static Object invokeMethod0SpreadSafe(Class senderClass, Object receiver, String messageName)

### invokeMethodN

    public static Object invokeMethodN(Class senderClass, Object receiver, String messageName, def messageArguments)

### invokeMethodNSafe

    public static Object invokeMethodNSafe(Class senderClass, Object receiver, String messageName, def messageArguments)

### invokeMethodNSpreadSafe

    public static Object invokeMethodNSpreadSafe(Class senderClass, Object receiver, String messageName, def messageArguments)

### invokeMethodOnCurrent0

    public static Object invokeMethodOnCurrent0(Class senderClass, GroovyObject receiver, String messageName)

### invokeMethodOnCurrent0Safe

    public static Object invokeMethodOnCurrent0Safe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnCurrent0SpreadSafe

    public static Object invokeMethodOnCurrent0SpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnCurrentN

    public static Object invokeMethodOnCurrentN(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnCurrentNSafe

    public static Object invokeMethodOnCurrentNSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnCurrentNSpreadSafe

    public static Object invokeMethodOnCurrentNSpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnSuper0

    public static Object invokeMethodOnSuper0(Class senderClass, GroovyObject receiver, String messageName)

### invokeMethodOnSuper0Safe

    public static Object invokeMethodOnSuper0Safe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnSuper0SpreadSafe

    public static Object invokeMethodOnSuper0SpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnSuperN

    public static Object invokeMethodOnSuperN(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnSuperNSafe

    public static Object invokeMethodOnSuperNSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeMethodOnSuperNSpreadSafe

    public static Object invokeMethodOnSuperNSpreadSafe(Class senderClass, GroovyObject receiver, String messageName, def messageArguments)

### invokeNew0

    public static Object invokeNew0(Class senderClass, Class receiver)

### invokeNewN

    public static Object invokeNewN(Class senderClass, Class receiver, Object arguments)

### invokeStaticMethod0

    public static Object invokeStaticMethod0(Class senderClass, Class receiver, String messageName)

### invokeStaticMethodN

    public static Object invokeStaticMethodN(Class senderClass, Class receiver, String messageName, def messageArguments)

### isCase

    public static boolean isCase(Object switchValue, Object caseExpression)

### isSpreadable

    static boolean isSpreadable(Object receiver)

### matchRegex

    public static boolean matchRegex(Object left, Object right)

### regexPattern

    public static Pattern regexPattern(Object regex)

### selectConstructorAndTransformArguments

    public static int selectConstructorAndTransformArguments(def arguments, int numberOfConstructors, Class which)

### setField

    public static void setField(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setFieldOnSuper

    public static void setFieldOnSuper(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setFieldOnSuperSafe

    public static void setFieldOnSuperSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setFieldOnSuperSpreadSafe

    public static void setFieldOnSuperSpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setFieldSafe

    public static void setFieldSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setFieldSpreadSafe

    public static void setFieldSpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setGroovyObjectField

    public static void setGroovyObjectField(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setGroovyObjectFieldSafe

    public static void setGroovyObjectFieldSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setGroovyObjectFieldSpreadSafe

    public static void setGroovyObjectFieldSpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setGroovyObjectProperty

    public static void setGroovyObjectProperty(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setGroovyObjectPropertySafe

    public static void setGroovyObjectPropertySafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setGroovyObjectPropertySpreadSafe

    public static void setGroovyObjectPropertySpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setProperty

    public static void setProperty(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setPropertyOnSuper

    public static void setPropertyOnSuper(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setPropertyOnSuperSafe

    public static void setPropertyOnSuperSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setPropertyOnSuperSpreadSafe

    public static void setPropertyOnSuperSpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)

### setPropertySafe

    public static void setPropertySafe(Object messageArgument, Class senderClass, Object receiver, String messageName)

### setPropertySpreadSafe

    public static void setPropertySpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)

### spreadMap

    public static Object spreadMap(Object value)

### unaryMinus

    public static Object unaryMinus(Object value)

### unaryPlus

    public static Object unaryPlus(Object value)

### unwrap

    static Throwable unwrap(GroovyRuntimeException gre)