KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > antmod > tasks > SetPropertyTask


1 package org.antmod.tasks;
2
3 import org.apache.tools.ant.BuildException;
4 import org.apache.tools.ant.Task;
5
6 /**
7  * Ant task allowing to set a property in the Ant project, even if it was set before.
8  * THIS BREAKS THE RULE OF PROPERTIES BEING IMMUTABLE!
9  */

10 public class SetPropertyTask extends Task {
11     private String JavaDoc name;
12     private String JavaDoc value;
13
14     public void setName(String JavaDoc name) {
15         this.name = name;
16     }
17
18     public void setValue(String JavaDoc value) {
19         this.value = value;
20     }
21     
22     public void execute() throws BuildException {
23         getProject().setProperty(name, value);
24     }
25 }
26
Popular Tags