public static Object bitwiseNegate(Object value) throws Throwable {
   try {
     return InvokerHelper.bitwiseNegate(value);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
 public static void setPropertyOnSuperSpreadSafe(
     Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)
     throws Throwable {
   for (Iterator it = InvokerHelper.asIterator(receiver); it.hasNext(); ) {
     setPropertySafe(messageArgument, senderClass, it.next(), messageName);
   }
 }
 public static Object unaryPlus(Object value) throws Throwable {
   try {
     return InvokerHelper.unaryPlus(value);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
 public static Object getPropertyOnSuperSpreadSafe(
     Class senderClass, GroovyObject receiver, String messageName) throws Throwable {
   List answer = new ArrayList();
   for (Iterator it = InvokerHelper.asIterator(receiver); it.hasNext(); ) {
     answer.add(getPropertySafe(senderClass, it.next(), messageName));
   }
   return answer;
 }
 public static void setGroovyObjectFieldSpreadSafe(
     Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)
     throws Throwable {
   if (receiver == null) return;
   for (Iterator it = InvokerHelper.asIterator(receiver); it.hasNext(); ) {
     setFieldSafe(messageArgument, senderClass, it.next(), messageName);
   }
 }
 //  --------------------------------------------------------
 //              normal constructor invocation (via new)
 //  --------------------------------------------------------
 public static Object invokeNewN(Class senderClass, Class receiver, Object arguments)
     throws Throwable {
   try {
     return InvokerHelper.invokeConstructorOf(receiver, arguments);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
 public static Object getProperty(Class senderClass, Object receiver, String messageName)
     throws Throwable {
   try {
     return InvokerHelper.getProperty(receiver, messageName);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
 public static void setPropertyOnSuper(
     Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)
     throws Throwable {
   try {
     InvokerHelper.setAttribute(receiver, messageName, messageArgument);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
 public static Object getFieldSpreadSafe(Class senderClass, Object receiver, String messageName)
     throws Throwable {
   if (receiver == null) return null;
   List answer = new ArrayList();
   for (Iterator it = InvokerHelper.asIterator(receiver); it.hasNext(); ) {
     answer.add(getFieldSafe(senderClass, it.next(), messageName));
   }
   return answer;
 }
示例#10
0
 public static Object invokeMethodOnSuperNSpreadSafe(
     Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)
     throws Throwable {
   List answer = new ArrayList();
   for (Iterator it = InvokerHelper.asIterator(receiver); it.hasNext(); ) {
     answer.add(invokeMethodNSafe(senderClass, it.next(), messageName, messageArguments));
   }
   return answer;
 }
示例#11
0
 //  --------------------------------------------------------
 //                static normal method invocation
 //  --------------------------------------------------------
 public static Object invokeStaticMethodN(
     Class senderClass, Class receiver, String messageName, Object[] messageArguments)
     throws Throwable {
   try {
     return InvokerHelper.invokeStaticMethod(receiver, messageName, messageArguments);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
示例#12
0
 public static void setProperty(
     Object messageArgument, Class senderClass, Object receiver, String messageName)
     throws Throwable {
   try {
     if (receiver == null) receiver = NullObject.getNullObject();
     InvokerHelper.setProperty(receiver, messageName, messageArgument);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
示例#13
0
 public static Object getFieldOnSuper(Class senderClass, Object receiver, String messageName)
     throws Throwable {
   try {
     if (receiver instanceof Class) {
       return InvokerHelper.getAttribute(receiver, messageName);
     } else {
       MetaClass mc = ((GroovyObject) receiver).getMetaClass();
       return mc.getAttribute(senderClass, receiver, messageName, true);
     }
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
示例#14
0
 public static Object unaryMinus(Object value) throws Throwable {
   return InvokerHelper.unaryMinus(value);
 }
示例#15
0
 public static Object spreadMap(Object value) {
   return InvokerHelper.spreadMap(value);
 }
示例#16
0
 public static boolean matchRegex(Object left, Object right) {
   return InvokerHelper.matchRegex(left, right);
 }
示例#17
0
 public static Matcher findRegex(Object left, Object right) throws Throwable {
   return InvokerHelper.findRegex(left, right);
 }
示例#18
0
 // assert
 public static void assertFailed(Object expression, Object message) {
   InvokerHelper.assertFailed(expression, message);
 }
示例#19
0
 public static Map createMap(Object[] values) {
   return InvokerHelper.createMap(values);
 }
示例#20
0
 public static List createList(Object[] values) {
   return InvokerHelper.createList(values);
 }
示例#21
0
 public static MetaClass initMetaClass(Object object) {
   return InvokerHelper.getMetaClass(object.getClass());
 }
示例#22
0
 /**
  * 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
  */
 public static Closure getMethodPointer(Object object, String methodName) {
   return InvokerHelper.getMethodPointer(object, methodName);
 }