diff --git a/src/main/org/apache/tools/ant/Target.java b/src/main/org/apache/tools/ant/Target.java
index 7536b720c..e76013fde 100644
--- a/src/main/org/apache/tools/ant/Target.java
+++ b/src/main/org/apache/tools/ant/Target.java
@@ -246,6 +246,16 @@ public class Target implements TaskContainer {
this.ifCondition = (property == null) ? "" : property;
}
+ /**
+ * Returns the "if" property condition of this target.
+ *
+ * @return the "if" property condition or null
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
@@ -263,6 +273,16 @@ public class Target implements TaskContainer {
this.unlessCondition = (property == null) ? "" : property;
}
+ /**
+ * Returns the "unless" property condition of this target.
+ *
+ * @return the "unless" property condition or null
+ * if no "unless" condition had been defined.
+ */
+ public String getUnless() {
+ return ("".equals(unlessCondition) ? null : unlessCondition);
+ }
+
/**
* Sets the description of this target.
*