From 0aea51ece71d4f3fab453ecc5f4afad5c6dca05a Mon Sep 17 00:00:00 2001 From: Jan Materne Date: Mon, 29 Oct 2007 16:19:14 +0000 Subject: [PATCH] Two constructors: for easier use and (then needed) for reflection. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@589715 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/TaskAdapter.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/org/apache/tools/ant/TaskAdapter.java b/src/main/org/apache/tools/ant/TaskAdapter.java index bc8b3deb6..c73d4363a 100644 --- a/src/main/org/apache/tools/ant/TaskAdapter.java +++ b/src/main/org/apache/tools/ant/TaskAdapter.java @@ -33,6 +33,26 @@ public class TaskAdapter extends Task implements TypeAdapter { /** Object to act as a proxy for. */ private Object proxy; + /** + * No-arg constructor for reflection. + */ + public TaskAdapter() { + } + + /** + * Constructor for given proxy. + * So you could write easier code + *
+     * myTaskContainer.addTask( new TaskAdapter(myProxy) );
+     * 
+ * + * @param proxy The object which Ant should use as task. + */ + public TaskAdapter(Object proxy) { + this(); + setProxy(proxy); + } + /** * Checks whether or not a class is suitable to be adapted by TaskAdapter. * If the class is of type Dispatchable, the check is not performed because