Exemplo n.º 1
0
 public static Object getField(Class senderClass, Object receiver, String messageName)
     throws Throwable {
   try {
     return InvokerHelper.getAttribute(receiver, messageName);
   } catch (GroovyRuntimeException gre) {
     throw unwrap(gre);
   }
 }
Exemplo n.º 2
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);
   }
 }