1 19 20 package org.netbeans.nbbuild; 21 22 23 import org.apache.tools.ant.BuildException; 24 import org.apache.tools.ant.Task; 25 26 31 @Deprecated 32 public class CheckValue extends Task { 33 String property = null; 34 String value = null; 35 String set = null; 36 String toValue = null; 37 38 39 public void setProperty(String property) { 40 this.property = property; 41 } 42 43 44 public void setIs(String value) { 45 this.value = value; 46 } 47 48 49 public void setSet(String set) { 50 this.set = set; 51 } 52 53 54 public void setTovalue(String toValue) { 55 this.toValue = toValue; 56 } 57 58 public void execute () throws BuildException { 59 if (property == null) 60 throw new BuildException( "Attribute \"property\" is mandantory" ); 61 if (value == null) 62 throw new BuildException( "Attribute \"is\" is mandantory" ); 63 if (set == null) 64 throw new BuildException( "Attribute \"set\" is mandantory" ); 65 if (toValue == null) 66 throw new BuildException( "Attribute \"toValue\" is mandantory" ); 67 68 String propValue = this.getProject().getUserProperty( property ); 69 if (propValue != null) { 70 if (propValue.equals(value)) { 71 this.getProject().setUserProperty( set, toValue ); 72 } 73 } 74 } 75 } 76 | Popular Tags |