--____________--
A
src/main/java/com/google/ant/extensions/tasks/PropertyTransformerTask.java
http://code.google.com/p/fant/source/detail?r=101
Added:
/trunk/src/main/java/com/google/ant/extensions/tasks/PropertyTransformerTask.java
=======================================
--- /dev/null
+++
/trunk/src/main/java/com/google/ant/extensions/tasks/PropertyTransformerTask.java
Thu Apr 1 20:29:38 2010
@@ -0,0 +1,47 @@
+package com.google.ant.extensions.tasks;
+
+import org.apache.tools.ant.Task;
+
+public class PropertyTransformerTask extends Task {
+ protected String property;
+ protected String expression;
+ protected String source;
+ protected String replacement;
+
+ public void setReplacement(String r) {
+ this.replacement = r;
+ }
+
+ public String getReplacement() {
+ return this.replacement;
+ }
+
+ public void setProperty(String p) {
+ this.property = p;
+ }
+
+ public String getProperty() {
+ return this.property;
+ }
+
+ public void setSource(String s) {
+ this.source = s;
+ }
+
+ public String getSource() {
+ return this.source;
+ }
+
+ public void setExpression(String exp) {
+ this.expression = exp;
+ }
+
+ public String getExpression() {
+ return this.expression;
+ }
+
+ public void execute() {
+ String result = getSource().replaceAll(getExpression(),
getReplacement());
+ getProject().setNewProperty(getProperty(), result);
+ }
+}