diff --git a/src/main/org/apache/tools/ant/util/ReflectUtil.java b/src/main/org/apache/tools/ant/util/ReflectUtil.java index 70be59a4e..36f570510 100644 --- a/src/main/org/apache/tools/ant/util/ReflectUtil.java +++ b/src/main/org/apache/tools/ant/util/ReflectUtil.java @@ -136,4 +136,28 @@ public class ReflectUtil { throw new BuildException(t); } } -} + + /** + * A method to test if an object responds to a given + * message (method call) + * @param o the object + * @param methodName the method to check for + * @return + * @throws BuildException + */ + public static boolean resondsTo(Object o, String methodName) + throws BuildException { + try { + Method[] methods = o.getClass().getMethods(); + for(int i=0; i