ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yuji Yamano <yyam...@kt.rim.or.jp>
Subject ConditionBase.java patch for supporting description attribute
Date Thu, 23 Nov 2006 08:51:47 GMT
Hi!

Subject says all. I'm not on the list, so plaease CC me on ant replies.

After reading the discussion at 
http://marc.theaimsgroup.com/?t=115947576800006&r=1&w=2 , 
I understand why ConditionBase must not be a subclass of Task. 
So I just add the field and setter/getter methods.

I hope it is integrated to Ant 1.7:-)

Index: src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java
===================================================================
--- src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java	(revision 478509)
+++ src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java	(working copy)
@@ -52,6 +52,12 @@
     private Vector conditions = new Vector();
 
     /**
+     * Description of this task, if any.
+     * @since since Ant 1.7
+     */
+    private String description;
+
+    /**
      * Simple constructor.
      */
     protected ConditionBase() {
@@ -285,6 +291,31 @@
     }
 
     /**
+     * Sets a description of the current action. This may be used for logging
+     * purposes.
+     *
+     * @param desc Description of the current action.
+     *             May be <code>null</code>, indicating that no description is
+     *             available.
+     * @since since Ant 1.7
+     *
+     */
+    public void setDescription(String desc) {
+        description = desc;
+    }
+
+    /**
+     * Returns the description of the current action.
+     *
+     * @return the description of the current action, or <code>null</code> if
+     *         no description is available.
+     * @since since Ant 1.7
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
      * Create a dynamically discovered condition.  Built-in conditions can
      * be discovered from the org.apache.tools.ant.taskdefs.condition
      * antlib.

-- 
Yuji Yamano

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message