1 2 3 package org.quilt.frontend.ant; 4 5 import org.apache.tools.ant.BuildException; 6 7 10 public class SummaryAttribute { 11 12 private String value; 13 private boolean bVal; 14 15 19 public SummaryAttribute (String v) { 20 setValue (v); 21 } 22 27 public String getValue() { 28 return value; 29 } 30 36 public final void setValue (String value) throws BuildException { 37 this.value = value.toLowerCase(); 38 if ( value.equals("on") || value.equals("true") 39 || value.equals("withoutanderr") || value.equals("yes") ) { 40 bVal = true; 41 } else if ( value.equals("false") || value.equals("no") 42 || value.equals("off" ) ) { 43 bVal = false; 44 } else { 45 throw new BuildException( 46 "invalid summary attribute value: " + value); 47 } 48 } 49 53 public boolean asBoolean() { 54 return bVal; 55 } 56 } 57 | Popular Tags |