ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Thu, 27 Jan 2000 03:50:24 GMT
stefano     00/01/26 19:50:24

  Modified:    src/main/org/apache/tools/ant Project.java
  Log:
  centralized and more generic method for evaluating boolean attributes
  
  Revision  Changes    Path
  1.5       +8 -0      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Project.java	2000/01/25 23:03:21	1.4
  +++ Project.java	2000/01/27 03:50:24	1.5
  @@ -474,6 +474,14 @@
           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.
  
  
  

Mime
View raw message