git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271430 13f79535-47bb-0310-9956-ffa450edef68master
@@ -54,7 +54,7 @@ It is <b>strongly</b> recommended to use Jakarta Oro. | |||||
<tr> | <tr> | ||||
<td valign="top">match</td> | <td valign="top">match</td> | ||||
<td valign="top">The regular expression pattern to match in the file(s)</td> | <td valign="top">The regular expression pattern to match in the file(s)</td> | ||||
<td align="center">Yes, if no nested <regularexpression> is used</td> | |||||
<td align="center">Yes, if no nested <regexp> is used</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">replace</td> | <td valign="top">replace</td> | ||||
@@ -94,12 +94,12 @@ value, in the file <code>${src}/build.properties</code></p> | |||||
<h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
<p>This task supports a nested <a href="../CoreTypes/fileset.html">FileSet</a> | <p>This task supports a nested <a href="../CoreTypes/fileset.html">FileSet</a> | ||||
element.</p> | element.</p> | ||||
<p>This task supports a nested <i>RegularExpression</i> element to specify | |||||
<p>This task supports a nested <i>Regexp</i> element to specify | |||||
the regular expression. You can use this element to refer to a previously | the regular expression. You can use this element to refer to a previously | ||||
defined regular expression datatype instance.</p> | defined regular expression datatype instance.</p> | ||||
<blockquote> | <blockquote> | ||||
<regularexpression id="id" pattern="expression" /><br /> | |||||
<regularexpression refid="id" /> | |||||
<regexp id="id" pattern="expression" /><br /> | |||||
<regexp refid="id" /> | |||||
</blockquote> | </blockquote> | ||||
<p>This task supports a nested <i>Substitution</i> element to specify | <p>This task supports a nested <i>Substitution</i> element to specify | ||||
the substitution pattern. You can use this element to refer to a previously | the substitution pattern. You can use this element to refer to a previously | ||||
@@ -112,7 +112,7 @@ value, in the file <code>${src}/build.properties</code></p> | |||||
<blockquote> | <blockquote> | ||||
<pre> | <pre> | ||||
<replaceregexp byline="true"> | <replaceregexp byline="true"> | ||||
<regularexpression expression="OldProperty=(.*)" /> | |||||
<regexp expression="OldProperty=(.*)" /> | |||||
<substitution expression="NewProperty=\1" /> | <substitution expression="NewProperty=\1" /> | ||||
<fileset dir="."> | <fileset dir="."> | ||||
<includes="*.properties" /> | <includes="*.properties" /> | ||||
@@ -10,7 +10,7 @@ | |||||
<target name="testReplace" depends="setup"> | <target name="testReplace" depends="setup"> | ||||
<replaceregexp file="test.properties" byline="true"> | <replaceregexp file="test.properties" byline="true"> | ||||
<regularexpression pattern="Old(.*)=(.*)" /> | |||||
<regexp pattern="Old(.*)=(.*)" /> | |||||
<substitution expression="NewProp=\1\2" /> | <substitution expression="NewProp=\1\2" /> | ||||
</replaceregexp> | </replaceregexp> | ||||
</target> | </target> | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -107,7 +107,7 @@ import java.util.Vector; | |||||
* replace="pattern" | * replace="pattern" | ||||
* flags="options"? | * flags="options"? | ||||
* byline="true|false"? > | * byline="true|false"? > | ||||
* regularexpression? | |||||
* regexp? | |||||
* substitution? | * substitution? | ||||
* fileset* | * fileset* | ||||
* </replaceregexp> | * </replaceregexp> | ||||
@@ -217,7 +217,7 @@ public class ReplaceRegExp extends Task | |||||
filesets.addElement(set); | filesets.addElement(set); | ||||
} | } | ||||
public RegularExpression createRegularExpression() | |||||
public RegularExpression createRegexp() | |||||
{ | { | ||||
if (regex != null) { | if (regex != null) { | ||||
throw new BuildException("Only one regular expression is allowed."); | throw new BuildException("Only one regular expression is allowed."); | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2001 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -83,7 +83,7 @@ import org.apache.tools.ant.util.regexp.RegexpFactory; | |||||
* </pre> | * </pre> | ||||
* | * | ||||
* <pre> | * <pre> | ||||
* <regularexpression [ [id="id"] pattern="expression" | refid="id" ] | |||||
* <regexp [ [id="id"] pattern="expression" | refid="id" ] | |||||
* /> | * /> | ||||
* </pre> | * </pre> | ||||
* | * | ||||
@@ -96,7 +96,7 @@ import org.apache.tools.ant.util.regexp.RegexpFactory; | |||||
*/ | */ | ||||
public class RegularExpression extends DataType | public class RegularExpression extends DataType | ||||
{ | { | ||||
public final static String DATA_TYPE_NAME = "regularexpression"; | |||||
public final static String DATA_TYPE_NAME = "regexp"; | |||||
// The regular expression factory | // The regular expression factory | ||||
private final static RegexpFactory factory = new RegexpFactory(); | private final static RegexpFactory factory = new RegexpFactory(); | ||||
@@ -151,7 +151,7 @@ public class RegularExpression extends DataType | |||||
Object o = ref.getReferencedObject(p); | Object o = ref.getReferencedObject(p); | ||||
if (!(o instanceof RegularExpression)) | if (!(o instanceof RegularExpression)) | ||||
{ | { | ||||
String msg = ref.getRefId() + " doesn\'t denote a regularexpression"; | |||||
String msg = ref.getRefId() + " doesn\'t denote a "+DATA_TYPE_NAME; | |||||
throw new BuildException(msg); | throw new BuildException(msg); | ||||
} | } | ||||
else | else | ||||
@@ -7,4 +7,4 @@ filterset=org.apache.tools.ant.types.FilterSet | |||||
description=org.apache.tools.ant.types.Description | description=org.apache.tools.ant.types.Description | ||||
classfileset=org.apache.tools.ant.types.optional.depend.ClassfileSet | classfileset=org.apache.tools.ant.types.optional.depend.ClassfileSet | ||||
substitution=org.apache.tools.ant.types.Substitution | substitution=org.apache.tools.ant.types.Substitution | ||||
regularexpression=org.apache.tools.ant.types.RegularExpression | |||||
regexp=org.apache.tools.ant.types.RegularExpression |