git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271338 13f79535-47bb-0310-9956-ffa450edef68master
@@ -24,7 +24,7 @@ import java.util.ArrayList; | |||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.FilterSet; | import org.apache.tools.ant.types.FilterSet; | ||||
import org.apache.tools.ant.types.FilterSetCollection; | |||||
import org.apache.myrmidon.framework.FilterSetCollection; | |||||
/** | /** | ||||
* A task used to copy files and simultaneously apply a | * A task used to copy files and simultaneously apply a | ||||
@@ -5,11 +5,12 @@ | |||||
* version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
* the LICENSE.txt file. | * the LICENSE.txt file. | ||||
*/ | */ | ||||
package org.apache.tools.ant.types;// java io classes | |||||
package org.apache.myrmidon.framework; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.FilterSet; | |||||
/** | /** | ||||
* A FilterSetCollection is a collection of filtersets each of which may have a | * A FilterSetCollection is a collection of filtersets each of which may have a |
@@ -21,7 +21,7 @@ import java.util.StringTokenizer; | |||||
import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.FilterSetCollection; | |||||
import org.apache.myrmidon.framework.FilterSetCollection; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
/** | /** | ||||
@@ -1,51 +0,0 @@ | |||||
/* | |||||
* Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
* | |||||
* This software is published under the terms of the Apache Software License | |||||
* version 1.1, a copy of which has been included with this distribution in | |||||
* the LICENSE.txt file. | |||||
*/ | |||||
package org.apache.tools.ant.types;// java io classes | |||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import org.apache.myrmidon.api.TaskException; | |||||
/** | |||||
* A FilterSetCollection is a collection of filtersets each of which may have a | |||||
* different start/end token settings. | |||||
* | |||||
* @author <A href="mailto:conor@apache.org">Conor MacNeill</A> | |||||
*/ | |||||
public class FilterSetCollection | |||||
{ | |||||
private ArrayList m_filterSets = new ArrayList(); | |||||
public void addFilterSet( final FilterSet filterSet ) | |||||
{ | |||||
m_filterSets.add( filterSet ); | |||||
} | |||||
/** | |||||
* Does replacement on the given string with token matching. This uses the | |||||
* defined begintoken and endtoken values which default to @ for both. | |||||
* | |||||
* @param line The line to process the tokens in. | |||||
* @return The string with the tokens replaced. | |||||
*/ | |||||
public String replaceTokens( String line ) | |||||
throws TaskException | |||||
{ | |||||
String replacedLine = line; | |||||
final Iterator filterSets = m_filterSets.iterator(); | |||||
while( filterSets.hasNext() ) | |||||
{ | |||||
final FilterSet filterSet = (FilterSet)filterSets.next(); | |||||
replacedLine = filterSet.replaceTokens( replacedLine ); | |||||
} | |||||
return replacedLine; | |||||
} | |||||
} | |||||
@@ -21,7 +21,7 @@ import java.util.StringTokenizer; | |||||
import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.FilterSetCollection; | |||||
import org.apache.myrmidon.framework.FilterSetCollection; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
/** | /** | ||||