| 555 | } |
| 556 | |
| 557 | public Object instanceInvoke(Object... args) throws DDFException { |
| 558 | if (this.getObject() == null) throw new DDFException("An object is required to invoke the given method"); |
| 559 | if (this.getMethod() == null) throw new DDFException("A method is required to invoke on the given object"); |
| 560 | |
| 561 | try { |
| 562 | return this.getMethod().invoke(this.getObject(), args); |
| 563 | |
| 564 | } catch (Exception e) { |
| 565 | throw new DDFException(String.format("Error while invoking method %s on object %s", this.getMethod().getName(), |
| 566 | this.getObject().getClass().getName()), e); |
| 567 | } |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | |