public static Object getField(Class senderClass, Object receiver, String messageName) throws Throwable { try { return InvokerHelper.getAttribute(receiver, messageName); } catch (GroovyRuntimeException gre) { throw unwrap(gre); } }
private Object extractNewValue(Object newObject) { Object newValue; try { newValue = InvokerHelper.getProperty(newObject, propertyName); } catch (MissingPropertyException mpe) { //todo we should flag this when the path is created that this is a field not a prop... // try direct method... try { newValue = InvokerHelper.getAttribute(newObject, propertyName); if (newValue instanceof Reference) { newValue = ((Reference) newValue).get(); } } catch (Exception e) { //LOGME? newValue = null; } } return newValue; }
/** * Note: This method may throw checked exceptions although it doesn't say so. */ public static Object getAttribute(Object target, String name) { try { return InvokerHelper.getAttribute(target, name); } catch (InvokerInvocationException e) { ExceptionUtil.sneakyThrow(e.getCause()); return null; // never reached } }
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); } }
public static Object getField(Class senderClass, Object receiver, String messageName) throws Throwable { try { return InvokerHelper.getAttribute(receiver, messageName); } catch (GroovyRuntimeException gre) { throw unwrap(gre); } }
public static Object getField(Class senderClass, Object receiver, String messageName) throws Throwable { try { return InvokerHelper.getAttribute(receiver, messageName); } catch (GroovyRuntimeException gre) { throw unwrap(gre); } }
public static Object getField(Class senderClass, Object receiver, String messageName) throws Throwable { try { return InvokerHelper.getAttribute(receiver, messageName); } catch (GroovyRuntimeException gre) { throw unwrap(gre); } }
public static Object getField(Class senderClass, Object receiver, String messageName) throws Throwable { try { return InvokerHelper.getAttribute(receiver, messageName); } catch (GroovyRuntimeException gre) { throw unwrap(gre); } }
private Object extractNewValue(Object newObject) { Object newValue; try { newValue = InvokerHelper.getProperty(newObject, propertyName); } catch (MissingPropertyException mpe) { //todo we should flag this when the path is created that this is a field not a prop... // try direct method... try { newValue = InvokerHelper.getAttribute(newObject, propertyName); if (newValue instanceof Reference) { newValue = ((Reference) newValue).get(); } } catch (Exception e) { //LOGME? newValue = null; } } return newValue; }
private Object extractNewValue(Object newObject) { Object newValue; try { newValue = InvokerHelper.getProperty(newObject, propertyName); } catch (MissingPropertyException mpe) { //todo we should flag this when the path is created that this is a field not a prop... // try direct method... try { newValue = InvokerHelper.getAttribute(newObject, propertyName); if (newValue instanceof Reference) { newValue = ((Reference) newValue).get(); } } catch (Exception e) { //LOGME? newValue = null; } } return newValue; }
private Object extractNewValue(Object newObject) { Object newValue; try { newValue = InvokerHelper.getProperty(newObject, propertyName); } catch (MissingPropertyException mpe) { //todo we should flag this whent he path is created that this is a field not a prop... // try direct method... try { newValue = InvokerHelper.getAttribute(newObject, propertyName); if (newValue instanceof Reference) { newValue = ((Reference) newValue).get(); } } catch (Exception e) { //LOGME? newValue = null; } } return newValue; }
private Object extractNewValue(Object newObject) { Object newValue; try { newValue = InvokerHelper.getProperty(newObject, propertyName); } catch (MissingPropertyException mpe) { //todo we should flag this whent he path is created that this is a field not a prop... // try direct method... try { newValue = InvokerHelper.getAttribute(newObject, propertyName); if (newValue instanceof Reference) { newValue = ((Reference) newValue).get(); } } catch (Exception e) { //LOGME? newValue = null; } } return newValue; }
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); } }
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); } }
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); } }
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); } }