From 961cbd0f458aa92a2c468e0f285976ec4fa9dcc8 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Fri, 19 Dec 2003 15:13:02 +0000 Subject: [PATCH] Add a setbyline(boolean) as well as a setbyline(String) to replaceregexp PR: 25653 Obtained from: Jesse Glick git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275817 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/optional/ReplaceRegExp.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java index f0b4bbaa7..7b91152f7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java @@ -242,6 +242,7 @@ public class ReplaceRegExp extends Task { * want to only replace the first occurrence of a regular expression on * each line, which is not easy to do when processing the file as a whole. * Defaults to false. + * @deprecated - use setByLine(boolean) */ public void setByLine(String byline) { Boolean res = Boolean.valueOf(byline); @@ -252,6 +253,17 @@ public class ReplaceRegExp extends Task { this.byline = res.booleanValue(); } + /** + * Process the file(s) one line at a time, executing the replacement + * on one line at a time. This is useful if you + * want to only replace the first occurrence of a regular expression on + * each line, which is not easy to do when processing the file as a whole. + * Defaults to false. + */ + public void setByLine(boolean byline) { + this.byline = byline; + } + /** * Specifies the encoding Ant expects the files to be in -