/** * 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) { String replacedLine = line; for (FilterSet filterSet : filterSets) { replacedLine = filterSet.replaceTokens(replacedLine); } return replacedLine; }
if (recurse && !value.equals(token)) { value = replaceTokens(value, token);
public String replaceTokens(String input) { return this.filter.replaceTokens(input); }
/** * Read the data from the input stream and write to the outputstream, filtering with an Ant FilterSet. * * @param in inputstream * @param out outputstream * @param set FilterSet to use * * @throws java.io.IOException if thrown by underlying io operations */ public static void copyStreamWithFilterSet(final InputStream in, final OutputStream out, final FilterSet set) throws IOException { final BufferedReader reader = new BufferedReader(new InputStreamReader(in)); final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out)); String lSep = System.getProperty("line.separator"); String line = reader.readLine(); while (null != line) { writer.write(set.replaceTokens(line)); writer.write(lSep); line = reader.readLine(); } writer.flush(); } }
String replaced = this.filter.replaceTokens(tmpStr); this.buffer = replaced.getBytes(); this.index = 0;
this.buffer = this.filter.replaceTokens(tmpStr); this.index = 0;