Browse Source

centralized and more generic method for evaluating boolean attributes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267568 13f79535-47bb-0310-9956-ffa450edef68
master
Stefano Mazzocchi 25 years ago
parent
commit
d4110f6b4e
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/main/org/apache/tools/ant/Project.java

+ 8
- 0
src/main/org/apache/tools/ant/Project.java View File

@@ -474,6 +474,14 @@ public class Project {
return(bs.toString());
}

// returns the boolean equivalent of a string, which is considered true
// if either "on", "true", or "yes" is found, case insensitiveness.
public static boolean toBoolean(String s) {
return (s.equalsIgnoreCase("on") ||
s.equalsIgnoreCase("true") ||
s.equalsIgnoreCase("yes"));
}
// Given a string defining a target name, and a Hashtable
// containing the "name to Target" mapping, pick out the
// Target and execute it.


Loading…
Cancel
Save