From 996bac3e36d40de24b24b28e7ac38504f0ed6eff Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Fri, 4 Jun 2004 15:39:16 +0000 Subject: [PATCH] Add getIf() and getUnless() to Target. PR: 29320 Submitted by: Christophe Labouisse git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276528 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/Target.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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. *