Browse Source

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
master
Peter Reilly 21 years ago
parent
commit
961cbd0f45
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java

+ 12
- 0
src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java View File

@@ -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 <i>false</i>.</td>
* @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 <i>false</i>.</td>
*/
public void setByLine(boolean byline) {
this.byline = byline;
}


/**
* Specifies the encoding Ant expects the files to be in -


Loading…
Cancel
Save