Edit C:\apache-ant-1.8.0\docs\manual\api\org\apache\tools\ant\taskdefs\optional\ReplaceRegExp.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_22) on Mon Feb 01 19:35:43 EST 2010 --> <TITLE> ReplaceRegExp (Apache Ant API) </TITLE> <META NAME="keywords" CONTENT="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="ReplaceRegExp (Apache Ant API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional"><B>PREV CLASS</B></A> <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> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html" target="_top"><B>FRAMES</B></A> <A HREF="ReplaceRegExp.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.apache.tools.ant.Task">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.tools.ant.taskdefs.optional</FONT> <BR> Class ReplaceRegExp</H2> <PRE> java.lang.Object <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> <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> <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.tools.ant.taskdefs.optional.ReplaceRegExp</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable</DD> </DL> <HR> <DL> <DT><PRE>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> </PRE> <P> Performs regular expression string replacements in a text file. The input file(s) must be able to be properly processed by a Reader instance. That is, they must be text only, no binary. The syntax of the regular expression depends on the implementation that you choose to use. The system property <code>ant.regexp.regexpimpl</code> will be the classname of the implementation that will be used (the default is <code>org.apache.tools.ant.util.regexp.JakartaOroRegexp</code> and requires the Jakarta Oro Package). <pre> Available implementations: org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (default) Uses Java's built-in regular expression package org.apache.tools.ant.util.regexp.JakartaOroRegexp Requires the jakarta-oro package org.apache.tools.ant.util.regexp.JakartaRegexpRegexp Requires the jakarta-regexp package Usage: Call Syntax: <replaceregexp file="file" match="pattern" replace="pattern" flags="options"? byline="true|false"? > regexp? substitution? fileset* </replaceregexp> NOTE: You must have either the file attribute specified, or at least one fileset subelement to operation on. You may not have the file attribute specified if you nest fileset elements inside this task. Also, you cannot specify both match and a regular expression subelement at the same time, nor can you specify the replace attribute and the substitution subelement at the same time. Attributes: file --> A single file to operation on (mutually exclusive with the fileset subelements) match --> The Regular expression to match replace --> The Expression replacement string flags --> The options to give to the replacement g = Substitute all occurrences. default is to replace only the first one i = Case insensitive match byline --> Should this file be processed a single line at a time (default is false) "true" indicates to perform replacement on a line by line basis "false" indicates to perform replacement on the whole file at once. Example: The following call could be used to replace an old property name in a ".properties" file with a new name. In the replace attribute, you can refer to any part of the match expression in parenthesis using backslash followed by a number like '\1'. <replaceregexp file="test.properties" match="MyProperty=(.*)" replace="NewProperty=\1" byline="true" /> </pre> <P> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> </TABLE> <A NAME="fields_inherited_from_class_org.apache.tools.ant.Task"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><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></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><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> </TR> </TABLE> <A NAME="fields_inherited_from_class_org.apache.tools.ant.ProjectComponent"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><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></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#description">description</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#location">location</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#project">project</A></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#ReplaceRegExp()">ReplaceRegExp</A></B>()</CODE> <BR> Default Constructor</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#addConfigured(org.apache.tools.ant.types.ResourceCollection)">addConfigured</A></B>(<A HREF="../../../../../../org/apache/tools/ant/types/ResourceCollection.html" title="interface in org.apache.tools.ant.types">ResourceCollection</A> rc)</CODE> <BR> Support arbitrary file system based resource collections.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <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> set)</CODE> <BR> list files to apply the replacement to</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#createRegexp()">createRegexp</A></B>()</CODE> <BR> A regular expression.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#createSubstitution()">createSubstitution</A></B>()</CODE> <BR> A substitution pattern.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#doReplace(java.io.File, int)">doReplace</A></B>(java.io.File f, int options)</CODE> <BR> Perform the replacement on a file</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected java.lang.String</CODE></FONT></TD> <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> r, <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A> s, java.lang.String input, int options)</CODE> <BR> Invoke a regular expression (r) on a string (input) using substitutions (s) for a matching regex.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#execute()">execute</A></B>()</CODE> <BR> Execute the task</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setByLine(boolean)">setByLine</A></B>(boolean byline)</CODE> <BR> Process the file(s) one line at a time, executing the replacement on one line at a time.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setByLine(java.lang.String)">setByLine</A></B>(java.lang.String byline)</CODE> <BR> <B>Deprecated.</B> <I>since 1.6.x. Use setByLine(boolean).</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setEncoding(java.lang.String)">setEncoding</A></B>(java.lang.String encoding)</CODE> <BR> Specifies the encoding Ant expects the files to be in - defaults to the platforms default encoding.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setFile(java.io.File)">setFile</A></B>(java.io.File file)</CODE> <BR> file for which the regular expression should be replaced; required unless a nested fileset is supplied.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setFlags(java.lang.String)">setFlags</A></B>(java.lang.String flags)</CODE> <BR> The flags to use when matching the regular expression.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setMatch(java.lang.String)">setMatch</A></B>(java.lang.String match)</CODE> <BR> the regular expression pattern to match in the file(s); required if no nested <regexp> is used</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setPreserveLastModified(boolean)">setPreserveLastModified</A></B>(boolean b)</CODE> <BR> Whether the file timestamp shall be preserved even if the file is modified.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setReplace(java.lang.String)">setReplace</A></B>(java.lang.String replace)</CODE> <BR> The substitution pattern to place in the file(s) in place of the regular expression.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_org.apache.tools.ant.Task"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><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></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../../org/apache/tools/ant/Task.html#bindToOwner(org.apache.tools.ant.Task)">bindToOwner</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#log(java.lang.String, java.lang.Throwable, int)">log</A>, <A HREF="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.Throwable, 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#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> </TR> </TABLE> <A NAME="methods_inherited_from_class_org.apache.tools.ant.ProjectComponent"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><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></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#clone()">clone</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#getDescription()">getDescription</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#getLocation()">getLocation</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#getProject()">getProject</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#setDescription(java.lang.String)">setDescription</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#setLocation(org.apache.tools.ant.Location)">setLocation</A>, <A HREF="../../../../../../org/apache/tools/ant/ProjectComponent.html#setProject(org.apache.tools.ant.Project)">setProject</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ReplaceRegExp()"><!-- --></A><H3> ReplaceRegExp</H3> <PRE> public <B>ReplaceRegExp</B>()</PRE> <DL> <DD>Default Constructor <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setFile(java.io.File)"><!-- --></A><H3> setFile</H3> <PRE> public void <B>setFile</B>(java.io.File file)</PRE> <DL> <DD>file for which the regular expression should be replaced; required unless a nested fileset is supplied. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>file</CODE> - The file for which the reg exp should be replaced.</DL> </DD> </DL> <HR> <A NAME="setMatch(java.lang.String)"><!-- --></A><H3> setMatch</H3> <PRE> public void <B>setMatch</B>(java.lang.String match)</PRE> <DL> <DD>the regular expression pattern to match in the file(s); required if no nested <regexp> is used <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>match</CODE> - the match attribute.</DL> </DD> </DL> <HR> <A NAME="setReplace(java.lang.String)"><!-- --></A><H3> setReplace</H3> <PRE> public void <B>setReplace</B>(java.lang.String replace)</PRE> <DL> <DD>The substitution pattern to place in the file(s) in place of the regular expression. Required if no nested <substitution> is used <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>replace</CODE> - the replace attribute</DL> </DD> </DL> <HR> <A NAME="setFlags(java.lang.String)"><!-- --></A><H3> setFlags</H3> <PRE> public void <B>setFlags</B>(java.lang.String flags)</PRE> <DL> <DD>The flags to use when matching the regular expression. For more information, consult the Perl5 syntax. <ul> <li>g : Global replacement. Replace all occurrences found <li>i : Case Insensitive. Do not consider case in the match <li>m : Multiline. Treat the string as multiple lines of input, using "^" and "$" as the start or end of any line, respectively, rather than start or end of string. <li> s : Singleline. Treat the string as a single line of input, using "." to match any character, including a newline, which normally, it would not match. </ul> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>flags</CODE> - the flags attribute</DL> </DD> </DL> <HR> <A NAME="setByLine(java.lang.String)"><!-- --></A><H3> setByLine</H3> <PRE> public void <B>setByLine</B>(java.lang.String byline)</PRE> <DL> <DD><B>Deprecated.</B> <I>since 1.6.x. Use setByLine(boolean).</I> <P> <DD>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> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>byline</CODE> - the byline attribute as a string</DL> </DD> </DL> <HR> <A NAME="setByLine(boolean)"><!-- --></A><H3> setByLine</H3> <PRE> public void <B>setByLine</B>(boolean byline)</PRE> <DL> <DD>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> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>byline</CODE> - the byline attribute</DL> </DD> </DL> <HR> <A NAME="setEncoding(java.lang.String)"><!-- --></A><H3> setEncoding</H3> <PRE> public void <B>setEncoding</B>(java.lang.String encoding)</PRE> <DL> <DD>Specifies the encoding Ant expects the files to be in - defaults to the platforms default encoding. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>encoding</CODE> - the encoding attribute<DT><B>Since:</B></DT> <DD>Ant 1.6</DD> </DL> </DD> </DL> <HR> <A NAME="addFileset(org.apache.tools.ant.types.FileSet)"><!-- --></A><H3> addFileset</H3> <PRE> public void <B>addFileset</B>(<A HREF="../../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</A> set)</PRE> <DL> <DD>list files to apply the replacement to <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>set</CODE> - the fileset element</DL> </DD> </DL> <HR> <A NAME="addConfigured(org.apache.tools.ant.types.ResourceCollection)"><!-- --></A><H3> addConfigured</H3> <PRE> public void <B>addConfigured</B>(<A HREF="../../../../../../org/apache/tools/ant/types/ResourceCollection.html" title="interface in org.apache.tools.ant.types">ResourceCollection</A> rc)</PRE> <DL> <DD>Support arbitrary file system based resource collections. <P> <DD><DL> <DT><B>Since:</B></DT> <DD>Ant 1.8.0</DD> </DL> </DD> </DL> <HR> <A NAME="createRegexp()"><!-- --></A><H3> createRegexp</H3> <PRE> public <A HREF="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</A> <B>createRegexp</B>()</PRE> <DL> <DD>A regular expression. You can use this element to refer to a previously defined regular expression datatype instance <P> <DD><DL> <DT><B>Returns:</B><DD>the regular expression object to be configured as an element</DL> </DD> </DL> <HR> <A NAME="createSubstitution()"><!-- --></A><H3> createSubstitution</H3> <PRE> public <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A> <B>createSubstitution</B>()</PRE> <DL> <DD>A substitution pattern. You can use this element to refer to a previously defined substitution pattern datatype instance. <P> <DD><DL> <DT><B>Returns:</B><DD>the substitution pattern object to be configured as an element</DL> </DD> </DL> <HR> <A NAME="setPreserveLastModified(boolean)"><!-- --></A><H3> setPreserveLastModified</H3> <PRE> public void <B>setPreserveLastModified</B>(boolean b)</PRE> <DL> <DD>Whether the file timestamp shall be preserved even if the file is modified. <P> <DD><DL> <DT><B>Since:</B></DT> <DD>Ant 1.8.0</DD> </DL> </DD> </DL> <HR> <A NAME="doReplace(org.apache.tools.ant.types.RegularExpression, org.apache.tools.ant.types.Substitution, java.lang.String, int)"><!-- --></A><H3> doReplace</H3> <PRE> protected 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> r, <A HREF="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</A> s, java.lang.String input, int options)</PRE> <DL> <DD>Invoke a regular expression (r) on a string (input) using substitutions (s) for a matching regex. <P> <DD><DL> <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 <DT><B>Returns:</B><DD>the replacement result</DL> </DD> </DL> <HR> <A NAME="doReplace(java.io.File, int)"><!-- --></A><H3> doReplace</H3> <PRE> protected void <B>doReplace</B>(java.io.File f, int options) throws java.io.IOException</PRE> <DL> <DD>Perform the replacement on a file <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>f</CODE> - the file to perform the relacement on<DD><CODE>options</CODE> - the regular expressions options <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE> - if an error occurs</DL> </DD> </DL> <HR> <A NAME="execute()"><!-- --></A><H3> execute</H3> <PRE> public void <B>execute</B>() throws <A HREF="../../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></PRE> <DL> <DD>Execute the task <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Throws:</B> <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> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional"><B>PREV CLASS</B></A> <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> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html" target="_top"><B>FRAMES</B></A> <A HREF="ReplaceRegExp.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.apache.tools.ant.Task">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de