mbenson 2004/06/04 08:39:16
Modified: src/main/org/apache/tools/ant Target.java
Log:
Add getIf() and getUnless() to Target.
PR: 29320
Submitted by: Christophe Labouisse
Revision Changes Path
1.53 +20 -0 ant/src/main/org/apache/tools/ant/Target.java
Index: Target.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- Target.java 26 Apr 2004 17:49:51 -0000 1.52
+++ Target.java 4 Jun 2004 15:39:16 -0000 1.53
@@ -247,6 +247,16 @@
}
/**
+ * Returns the "if" property condition of this target.
+ *
+ * @return the "if" property condition or <code>null</code> if no
+ * "if" condition had been defined.
+ */
+ public String getIf() {
+ return ("".equals(ifCondition) ? null : ifCondition);
+ }
+
+ /**
* Sets the "unless" condition to test on execution. This is the
* name of a property to test for existence - if the property
* is set, the task will not execute. The property goes
@@ -261,6 +271,16 @@
*/
public void setUnless(String property) {
this.unlessCondition = (property == null) ? "" : property;
+ }
+
+ /**
+ * Returns the "unless" property condition of this target.
+ *
+ * @return the "unless" property condition or <code>null</code>
+ * if no "unless" condition had been defined.
+ */
+ public String getUnless() {
+ return ("".equals(unlessCondition) ? null : unlessCondition);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]