source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/manual/api/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 31.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.4.2_13) on Mon Oct 01 14:33:24 NZST 2007 -->
6<TITLE>
7ReplaceRegExp (Apache Ant API)
8</TITLE>
9
10<META NAME="keywords" CONTENT="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp class">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17 parent.document.title="ReplaceRegExp (Apache Ant API)";
18}
19</SCRIPT>
20
21</HEAD>
22
23<BODY BGCOLOR="white" onload="windowTitle();">
24
25
26<!-- ========= START OF TOP NAVBAR ======= -->
27<A NAME="navbar_top"><!-- --></A>
28<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
29<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
30<TR>
31<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
32<A NAME="navbar_top_firstrow"><!-- --></A>
33<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
34 <TR ALIGN="center" VALIGN="top">
35 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
36 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
37 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
42 </TR>
43</TABLE>
44</TD>
45<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
46</EM>
47</TD>
48</TR>
49
50<TR>
51<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
52&nbsp;<A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional"><B>PREV CLASS</B></A>&nbsp;
53&nbsp;<A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/Rpm.html" title="class in org.apache.tools.ant.taskdefs.optional"><B>NEXT CLASS</B></A></FONT></TD>
54<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
55 <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
56&nbsp;<A HREF="ReplaceRegExp.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
57&nbsp;<SCRIPT type="text/javascript">
58 <!--
59 if(window==top) {
60 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
61 }
62 //-->
63</SCRIPT>
64<NOSCRIPT>
65 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
66</NOSCRIPT>
67
68</FONT></TD>
69</TR>
70<TR>
71<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
72 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.tools.ant.Task">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
73<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
74DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
75</TR>
76</TABLE>
77<A NAME="skip-navbar_top"></A>
78<!-- ========= END OF TOP NAVBAR ========= -->
79
80<HR>
81<!-- ======== START OF CLASS DATA ======== -->
82<H2>
83<FONT SIZE="-1">
84org.apache.tools.ant.taskdefs.optional</FONT>
85<BR>
86Class ReplaceRegExp</H2>
87<PRE>
88java.lang.Object
89 <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">org.apache.tools.ant.ProjectComponent</A>
90 <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">org.apache.tools.ant.Task</A>
91 <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.tools.ant.taskdefs.optional.ReplaceRegExp</B>
92</PRE>
93<HR>
94<DL>
95<DT>public class <B>ReplaceRegExp</B><DT>extends <A HREF="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</A></DL>
96
97<P>
98Performs regular expression string replacements in a text
99 file. The input file(s) must be able to be properly processed by
100 a Reader instance. That is, they must be text only, no binary.
101
102 The syntax of the regular expression depends on the implementation that
103 you choose to use. The system property <code>ant.regexp.regexpimpl</code>
104 will be the classname of the implementation that will be used (the default
105 is <code>org.apache.tools.ant.util.regexp.JakartaOroRegexp</code> and
106 requires the Jakarta Oro Package).
107
108 <pre>
109 For jdk &lt;= 1.3, there are two available implementations:
110 org.apache.tools.ant.util.regexp.JakartaOroRegexp (the default)
111 Requires the jakarta-oro package
112
113 org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
114 Requires the jakarta-regexp package
115
116 For jdk &gt;= 1.4 an additional implementation is available:
117 org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
118 Requires the jdk 1.4 built in regular expression package.
119
120 Usage:
121
122 Call Syntax:
123
124 &lt;replaceregexp file="file"
125 match="pattern"
126 replace="pattern"
127 flags="options"?
128 byline="true|false"? &gt;
129 regexp?
130 substitution?
131 fileset*
132 &lt;/replaceregexp&gt;
133
134 NOTE: You must have either the file attribute specified, or at least one fileset subelement
135 to operation on. You may not have the file attribute specified if you nest fileset elements
136 inside this task. Also, you cannot specify both match and a regular expression subelement at
137 the same time, nor can you specify the replace attribute and the substitution subelement at
138 the same time.
139
140 Attributes:
141
142 file --&gt; A single file to operation on (mutually exclusive
143 with the fileset subelements)
144 match --&gt; The Regular expression to match
145 replace --&gt; The Expression replacement string
146 flags --&gt; The options to give to the replacement
147 g = Substitute all occurrences. default is to replace only the first one
148 i = Case insensitive match
149
150 byline --&gt; Should this file be processed a single line at a time (default is false)
151 "true" indicates to perform replacement on a line by line basis
152 "false" indicates to perform replacement on the whole file at once.
153
154 Example:
155
156 The following call could be used to replace an old property name in a ".properties"
157 file with a new name. In the replace attribute, you can refer to any part of the
158 match expression in parenthesis using backslash followed by a number like '\1'.
159
160 &lt;replaceregexp file="test.properties"
161 match="MyProperty=(.*)"
162 replace="NewProperty=\1"
163 byline="true" /&gt;
164
165 </pre>
166<P>
167
168<P>
169<HR>
170
171<P>
172<!-- ======== NESTED CLASS SUMMARY ======== -->
173
174
175<!-- =========== FIELD SUMMARY =========== -->
176
177<A NAME="field_summary"><!-- --></A>
178<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
179<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
180<TD COLSPAN=2><FONT SIZE="+2">
181<B>Field Summary</B></FONT></TD>
182</TR>
183</TABLE>
184&nbsp;<A NAME="fields_inherited_from_class_org.apache.tools.ant.Task"><!-- --></A>
185<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
186<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
187<TD><B>Fields inherited from class org.apache.tools.ant.<A HREF="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</A></B></TD>
188</TR>
189<TR BGCOLOR="white" CLASS="TableRowColor">
190<TD><CODE><A HREF="../../../../../../org/apache/tools/ant/Task.html#description">description</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#location">location</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#target">target</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#taskName">taskName</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#taskType">taskType</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#wrapper">wrapper</A></CODE></TD>
191</TR>
192</TABLE>
193&nbsp;<A NAME="fields_inherited_from_class_org.apache.tools.ant.ProjectComponent"><!-- --></A>
194<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
195<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
196<TD><B>Fields inherited from class org.apache.tools.ant.<A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</A></B></TD>
197</TR>
198<TR BGCOLOR="white" CLASS="TableRowColor">
199<TD><CODE><A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#project">project</A></CODE></TD>
200</TR>
201</TABLE>
202&nbsp;
203<!-- ======== CONSTRUCTOR SUMMARY ======== -->
204
205<A NAME="constructor_summary"><!-- --></A>
206<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
207<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
208<TD COLSPAN=2><FONT SIZE="+2">
209<B>Constructor Summary</B></FONT></TD>
210</TR>
211<TR BGCOLOR="white" CLASS="TableRowColor">
212<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#ReplaceRegExp()">ReplaceRegExp</A></B>()</CODE>
213
214<BR>
215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default Constructor</TD>
216</TR>
217</TABLE>
218&nbsp;
219<!-- ========== METHOD SUMMARY =========== -->
220
221<A NAME="method_summary"><!-- --></A>
222<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
223<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
224<TD COLSPAN=2><FONT SIZE="+2">
225<B>Method Summary</B></FONT></TD>
226</TR>
227<TR BGCOLOR="white" CLASS="TableRowColor">
228<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
229<CODE>&nbsp;void</CODE></FONT></TD>
230<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#addFileset(org.apache.tools.ant.types.FileSet)">addFileset</A></B>(<A HREF="../../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</A>&nbsp;set)</CODE>
231
232<BR>
233&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list files to apply the replacement to</TD>
234</TR>
235<TR BGCOLOR="white" CLASS="TableRowColor">
236<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
237<CODE>&nbsp;<A HREF="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</A></CODE></FONT></TD>
238<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#createRegexp()">createRegexp</A></B>()</CODE>
239
240<BR>
241&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A regular expression.</TD>
242</TR>
243<TR BGCOLOR="white" CLASS="TableRowColor">
244<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
245<CODE>&nbsp;<A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A></CODE></FONT></TD>
246<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#createSubstitution()">createSubstitution</A></B>()</CODE>
247
248<BR>
249&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A substitution pattern.</TD>
250</TR>
251<TR BGCOLOR="white" CLASS="TableRowColor">
252<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
253<CODE>protected &nbsp;void</CODE></FONT></TD>
254<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#doReplace(java.io.File, int)">doReplace</A></B>(java.io.File&nbsp;f,
255 int&nbsp;options)</CODE>
256
257<BR>
258&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perform the replacement on a file</TD>
259</TR>
260<TR BGCOLOR="white" CLASS="TableRowColor">
261<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
262<CODE>protected &nbsp;java.lang.String</CODE></FONT></TD>
263<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#doReplace(org.apache.tools.ant.types.RegularExpression, org.apache.tools.ant.types.Substitution, java.lang.String, int)">doReplace</A></B>(<A HREF="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</A>&nbsp;r,
264 <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A>&nbsp;s,
265 java.lang.String&nbsp;input,
266 int&nbsp;options)</CODE>
267
268<BR>
269&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invoke a regular expression (r) on a string (input) using
270 substitutions (s) for a matching regex.</TD>
271</TR>
272<TR BGCOLOR="white" CLASS="TableRowColor">
273<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
274<CODE>&nbsp;void</CODE></FONT></TD>
275<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#execute()">execute</A></B>()</CODE>
276
277<BR>
278&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Execute the task</TD>
279</TR>
280<TR BGCOLOR="white" CLASS="TableRowColor">
281<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
282<CODE>&nbsp;void</CODE></FONT></TD>
283<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setByLine(boolean)">setByLine</A></B>(boolean&nbsp;byline)</CODE>
284
285<BR>
286&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process the file(s) one line at a time, executing the replacement
287 on one line at a time.</TD>
288</TR>
289<TR BGCOLOR="white" CLASS="TableRowColor">
290<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
291<CODE>&nbsp;void</CODE></FONT></TD>
292<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setByLine(java.lang.String)">setByLine</A></B>(java.lang.String&nbsp;byline)</CODE>
293
294<BR>
295&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>- use setByLine(boolean)</I></TD>
296</TR>
297<TR BGCOLOR="white" CLASS="TableRowColor">
298<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
299<CODE>&nbsp;void</CODE></FONT></TD>
300<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setEncoding(java.lang.String)">setEncoding</A></B>(java.lang.String&nbsp;encoding)</CODE>
301
302<BR>
303&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the encoding Ant expects the files to be in -
304 defaults to the platforms default encoding.</TD>
305</TR>
306<TR BGCOLOR="white" CLASS="TableRowColor">
307<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
308<CODE>&nbsp;void</CODE></FONT></TD>
309<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setFile(java.io.File)">setFile</A></B>(java.io.File&nbsp;file)</CODE>
310
311<BR>
312&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file for which the regular expression should be replaced;
313 required unless a nested fileset is supplied.</TD>
314</TR>
315<TR BGCOLOR="white" CLASS="TableRowColor">
316<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
317<CODE>&nbsp;void</CODE></FONT></TD>
318<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setFlags(java.lang.String)">setFlags</A></B>(java.lang.String&nbsp;flags)</CODE>
319
320<BR>
321&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The flags to use when matching the regular expression.</TD>
322</TR>
323<TR BGCOLOR="white" CLASS="TableRowColor">
324<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
325<CODE>&nbsp;void</CODE></FONT></TD>
326<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setMatch(java.lang.String)">setMatch</A></B>(java.lang.String&nbsp;match)</CODE>
327
328<BR>
329&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the regular expression pattern to match in the file(s);
330 required if no nested &lt;regexp&gt; is used</TD>
331</TR>
332<TR BGCOLOR="white" CLASS="TableRowColor">
333<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
334<CODE>&nbsp;void</CODE></FONT></TD>
335<TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setReplace(java.lang.String)">setReplace</A></B>(java.lang.String&nbsp;replace)</CODE>
336
337<BR>
338&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The substitution pattern to place in the file(s) in place
339 of the regular expression.</TD>
340</TR>
341</TABLE>
342&nbsp;<A NAME="methods_inherited_from_class_org.apache.tools.ant.Task"><!-- --></A>
343<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
344<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
345<TD><B>Methods inherited from class org.apache.tools.ant.<A HREF="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</A></B></TD>
346</TR>
347<TR BGCOLOR="white" CLASS="TableRowColor">
348<TD><CODE><A HREF="../../../../../../org/apache/tools/ant/Task.html#getDescription()">getDescription</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#getLocation()">getLocation</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#getOwningTarget()">getOwningTarget</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#getRuntimeConfigurableWrapper()">getRuntimeConfigurableWrapper</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#getTaskName()">getTaskName</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#getTaskType()">getTaskType</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#getWrapper()">getWrapper</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#handleErrorFlush(java.lang.String)">handleErrorFlush</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#handleErrorOutput(java.lang.String)">handleErrorOutput</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#handleFlush(java.lang.String)">handleFlush</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#handleInput(byte[], int, int)">handleInput</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#handleOutput(java.lang.String)">handleOutput</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#init()">init</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#isInvalid()">isInvalid</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.String)">log</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.String, int)">log</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#maybeConfigure()">maybeConfigure</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#perform()">perform</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#reconfigure()">reconfigure</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#setDescription(java.lang.String)">setDescription</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#setLocation(org.apache.tools.ant.Location)">setLocation</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#setOwningTarget(org.apache.tools.ant.Target)">setOwningTarget</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#setRuntimeConfigurableWrapper(org.apache.tools.ant.RuntimeConfigurable)">setRuntimeConfigurableWrapper</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#setTaskName(java.lang.String)">setTaskName</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#setTaskType(java.lang.String)">setTaskType</A></CODE></TD>
349</TR>
350</TABLE>
351&nbsp;<A NAME="methods_inherited_from_class_org.apache.tools.ant.ProjectComponent"><!-- --></A>
352<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
353<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
354<TD><B>Methods inherited from class org.apache.tools.ant.<A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</A></B></TD>
355</TR>
356<TR BGCOLOR="white" CLASS="TableRowColor">
357<TD><CODE><A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#getProject()">getProject</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#setProject(org.apache.tools.ant.Project)">setProject</A></CODE></TD>
358</TR>
359</TABLE>
360&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
361<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
362<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
363<TD><B>Methods inherited from class java.lang.Object</B></TD>
364</TR>
365<TR BGCOLOR="white" CLASS="TableRowColor">
366<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
367</TR>
368</TABLE>
369&nbsp;
370<P>
371
372<!-- ============ FIELD DETAIL =========== -->
373
374
375<!-- ========= CONSTRUCTOR DETAIL ======== -->
376
377<A NAME="constructor_detail"><!-- --></A>
378<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
379<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
380<TD COLSPAN=1><FONT SIZE="+2">
381<B>Constructor Detail</B></FONT></TD>
382</TR>
383</TABLE>
384
385<A NAME="ReplaceRegExp()"><!-- --></A><H3>
386ReplaceRegExp</H3>
387<PRE>
388public <B>ReplaceRegExp</B>()</PRE>
389<DL>
390<DD>Default Constructor
391<P>
392</DL>
393
394<!-- ============ METHOD DETAIL ========== -->
395
396<A NAME="method_detail"><!-- --></A>
397<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
398<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
399<TD COLSPAN=1><FONT SIZE="+2">
400<B>Method Detail</B></FONT></TD>
401</TR>
402</TABLE>
403
404<A NAME="setFile(java.io.File)"><!-- --></A><H3>
405setFile</H3>
406<PRE>
407public void <B>setFile</B>(java.io.File&nbsp;file)</PRE>
408<DL>
409<DD>file for which the regular expression should be replaced;
410 required unless a nested fileset is supplied.
411<P>
412<DD><DL>
413<DT><B>Parameters:</B><DD><CODE>file</CODE> - The file for which the reg exp should be replaced.</DL>
414</DD>
415</DL>
416<HR>
417
418<A NAME="setMatch(java.lang.String)"><!-- --></A><H3>
419setMatch</H3>
420<PRE>
421public void <B>setMatch</B>(java.lang.String&nbsp;match)</PRE>
422<DL>
423<DD>the regular expression pattern to match in the file(s);
424 required if no nested &lt;regexp&gt; is used
425<P>
426<DD><DL>
427<DT><B>Parameters:</B><DD><CODE>match</CODE> - the match attribute.</DL>
428</DD>
429</DL>
430<HR>
431
432<A NAME="setReplace(java.lang.String)"><!-- --></A><H3>
433setReplace</H3>
434<PRE>
435public void <B>setReplace</B>(java.lang.String&nbsp;replace)</PRE>
436<DL>
437<DD>The substitution pattern to place in the file(s) in place
438 of the regular expression.
439 Required if no nested &lt;substitution&gt; is used
440<P>
441<DD><DL>
442<DT><B>Parameters:</B><DD><CODE>replace</CODE> - the replace attribute</DL>
443</DD>
444</DL>
445<HR>
446
447<A NAME="setFlags(java.lang.String)"><!-- --></A><H3>
448setFlags</H3>
449<PRE>
450public void <B>setFlags</B>(java.lang.String&nbsp;flags)</PRE>
451<DL>
452<DD>The flags to use when matching the regular expression. For more
453 information, consult the Perl5 syntax.
454 <ul>
455 <li>g : Global replacement. Replace all occurrences found
456 <li>i : Case Insensitive. Do not consider case in the match
457 <li>m : Multiline. Treat the string as multiple lines of input,
458 using "^" and "$" as the start or end of any line, respectively,
459 rather than start or end of string.
460 <li> s : Singleline. Treat the string as a single line of input, using
461 "." to match any character, including a newline, which normally,
462 it would not match.
463</ul>
464<P>
465<DD><DL>
466<DT><B>Parameters:</B><DD><CODE>flags</CODE> - the flags attribute</DL>
467</DD>
468</DL>
469<HR>
470
471<A NAME="setByLine(java.lang.String)"><!-- --></A><H3>
472setByLine</H3>
473<PRE>
474public void <B>setByLine</B>(java.lang.String&nbsp;byline)</PRE>
475<DL>
476<DD><B>Deprecated.</B>&nbsp;<I>- use setByLine(boolean)</I>
477<P>
478<DD>Process the file(s) one line at a time, executing the replacement
479 on one line at a time. This is useful if you
480 want to only replace the first occurrence of a regular expression on
481 each line, which is not easy to do when processing the file as a whole.
482 Defaults to <i>false</i>.</td>
483<P>
484<DD><DL>
485<DT><B>Parameters:</B><DD><CODE>byline</CODE> - the byline attribute as a string</DL>
486</DD>
487</DL>
488<HR>
489
490<A NAME="setByLine(boolean)"><!-- --></A><H3>
491setByLine</H3>
492<PRE>
493public void <B>setByLine</B>(boolean&nbsp;byline)</PRE>
494<DL>
495<DD>Process the file(s) one line at a time, executing the replacement
496 on one line at a time. This is useful if you
497 want to only replace the first occurrence of a regular expression on
498 each line, which is not easy to do when processing the file as a whole.
499 Defaults to <i>false</i>.</td>
500<P>
501<DD><DL>
502<DT><B>Parameters:</B><DD><CODE>byline</CODE> - the byline attribute</DL>
503</DD>
504</DL>
505<HR>
506
507<A NAME="setEncoding(java.lang.String)"><!-- --></A><H3>
508setEncoding</H3>
509<PRE>
510public void <B>setEncoding</B>(java.lang.String&nbsp;encoding)</PRE>
511<DL>
512<DD>Specifies the encoding Ant expects the files to be in -
513 defaults to the platforms default encoding.
514<P>
515<DD><DL>
516<DT><B>Parameters:</B><DD><CODE>encoding</CODE> - the encoding attribute<DT><B>Since:</B></DT>
517 <DD>Ant 1.6</DD>
518</DL>
519</DD>
520</DL>
521<HR>
522
523<A NAME="addFileset(org.apache.tools.ant.types.FileSet)"><!-- --></A><H3>
524addFileset</H3>
525<PRE>
526public void <B>addFileset</B>(<A HREF="../../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</A>&nbsp;set)</PRE>
527<DL>
528<DD>list files to apply the replacement to
529<P>
530<DD><DL>
531<DT><B>Parameters:</B><DD><CODE>set</CODE> - the fileset element</DL>
532</DD>
533</DL>
534<HR>
535
536<A NAME="createRegexp()"><!-- --></A><H3>
537createRegexp</H3>
538<PRE>
539public <A HREF="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</A> <B>createRegexp</B>()</PRE>
540<DL>
541<DD>A regular expression.
542 You can use this element to refer to a previously
543 defined regular expression datatype instance
544<P>
545<DD><DL>
546
547<DT><B>Returns:</B><DD>the regular expression object to be configured as an element</DL>
548</DD>
549</DL>
550<HR>
551
552<A NAME="createSubstitution()"><!-- --></A><H3>
553createSubstitution</H3>
554<PRE>
555public <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A> <B>createSubstitution</B>()</PRE>
556<DL>
557<DD>A substitution pattern. You can use this element to refer to a previously
558 defined substitution pattern datatype instance.
559<P>
560<DD><DL>
561
562<DT><B>Returns:</B><DD>the substitution pattern object to be configured as an element</DL>
563</DD>
564</DL>
565<HR>
566
567<A NAME="doReplace(org.apache.tools.ant.types.RegularExpression, org.apache.tools.ant.types.Substitution, java.lang.String, int)"><!-- --></A><H3>
568doReplace</H3>
569<PRE>
570protected java.lang.String <B>doReplace</B>(<A HREF="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</A>&nbsp;r,
571 <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A>&nbsp;s,
572 java.lang.String&nbsp;input,
573 int&nbsp;options)</PRE>
574<DL>
575<DD>Invoke a regular expression (r) on a string (input) using
576 substitutions (s) for a matching regex.
577<P>
578<DD><DL>
579<DT><B>Parameters:</B><DD><CODE>r</CODE> - a regular expression<DD><CODE>s</CODE> - a Substitution<DD><CODE>input</CODE> - the string to do the replacement on<DD><CODE>options</CODE> - The options for the regular expression
580<DT><B>Returns:</B><DD>the replacement result</DL>
581</DD>
582</DL>
583<HR>
584
585<A NAME="doReplace(java.io.File, int)"><!-- --></A><H3>
586doReplace</H3>
587<PRE>
588protected void <B>doReplace</B>(java.io.File&nbsp;f,
589 int&nbsp;options)
590 throws java.io.IOException</PRE>
591<DL>
592<DD>Perform the replacement on a file
593<P>
594<DD><DL>
595<DT><B>Parameters:</B><DD><CODE>f</CODE> - the file to perform the relacement on<DD><CODE>options</CODE> - the regular expressions options
596<DT><B>Throws:</B>
597<DD><CODE>java.io.IOException</CODE> - if an error occurs</DL>
598</DD>
599</DL>
600<HR>
601
602<A NAME="execute()"><!-- --></A><H3>
603execute</H3>
604<PRE>
605public void <B>execute</B>()
606 throws <A HREF="../../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></PRE>
607<DL>
608<DD>Execute the task
609<P>
610<DD><DL>
611<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../../org/apache/tools/ant/Task.html#execute()">execute</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</A></CODE></DL>
612</DD>
613<DD><DL>
614
615<DT><B>Throws:</B>
616<DD><CODE><A HREF="../../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></CODE> - is there is a problem in the task execution.</DL>
617</DD>
618</DL>
619<!-- ========= END OF CLASS DATA ========= -->
620<HR>
621
622
623<!-- ======= START OF BOTTOM NAVBAR ====== -->
624<A NAME="navbar_bottom"><!-- --></A>
625<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
626<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
627<TR>
628<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
629<A NAME="navbar_bottom_firstrow"><!-- --></A>
630<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
631 <TR ALIGN="center" VALIGN="top">
632 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
633 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
634 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
635 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
636 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
637 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
638 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
639 </TR>
640</TABLE>
641</TD>
642<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
643</EM>
644</TD>
645</TR>
646
647<TR>
648<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
649&nbsp;<A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional"><B>PREV CLASS</B></A>&nbsp;
650&nbsp;<A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/Rpm.html" title="class in org.apache.tools.ant.taskdefs.optional"><B>NEXT CLASS</B></A></FONT></TD>
651<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
652 <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
653&nbsp;<A HREF="ReplaceRegExp.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
654&nbsp;<SCRIPT type="text/javascript">
655 <!--
656 if(window==top) {
657 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
658 }
659 //-->
660</SCRIPT>
661<NOSCRIPT>
662 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
663</NOSCRIPT>
664
665</FONT></TD>
666</TR>
667<TR>
668<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
669 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.tools.ant.Task">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
670<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
671DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
672</TR>
673</TABLE>
674<A NAME="skip-navbar_bottom"></A>
675<!-- ======== END OF BOTTOM NAVBAR ======= -->
676
677<HR>
678Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.
679</BODY>
680</HTML>
Note: See TracBrowser for help on using the repository browser.