Browse Source

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
master
Matthew Jason Benson 21 years ago
parent
commit
996bac3e36
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      src/main/org/apache/tools/ant/Target.java

+ 20
- 0
src/main/org/apache/tools/ant/Target.java View File

@@ -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 <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
@@ -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 <code>null</code>
* if no "unless" condition had been defined.
*/
public String getUnless() {
return ("".equals(unlessCondition) ? null : unlessCondition);
}

/**
* Sets the description of this target.
*


Loading…
Cancel
Save