Methods Summary |
---|
public void | add(org.apache.tools.ant.filters.TokenFilter$Filter filter)Add an arbitrary filter
filters.addElement(filter);
|
public void | add(org.apache.tools.ant.util.Tokenizer tokenizer)add an arbitrary tokenizer
if (this.tokenizer != null) {
throw new BuildException("Only one tokenizer allowed");
}
this.tokenizer = tokenizer;
|
public void | addContainsRegex(org.apache.tools.ant.filters.TokenFilter$ContainsRegex filter)contains regex filter
filters.addElement(filter);
|
public void | addContainsString(org.apache.tools.ant.filters.TokenFilter$ContainsString filter)contains string filter
filters.addElement(filter);
|
public void | addDeleteCharacters(org.apache.tools.ant.filters.TokenFilter$DeleteCharacters filter)delete chars
filters.addElement(filter);
|
public void | addFileTokenizer(org.apache.tools.ant.filters.TokenFilter$FileTokenizer tokenizer)add a file tokenizer
add(tokenizer);
|
public void | addIgnoreBlank(org.apache.tools.ant.filters.TokenFilter$IgnoreBlank filter)ignore blank filter
filters.addElement(filter);
|
public void | addLineTokenizer(org.apache.tools.ant.util.LineTokenizer tokenizer)add a line tokenizer - this is the default.
add(tokenizer);
|
public void | addReplaceRegex(org.apache.tools.ant.filters.TokenFilter$ReplaceRegex filter)replace regex filter
filters.addElement(filter);
|
public void | addReplaceString(org.apache.tools.ant.filters.TokenFilter$ReplaceString filter)replace string filter
filters.addElement(filter);
|
public void | addStringTokenizer(org.apache.tools.ant.filters.TokenFilter$StringTokenizer tokenizer)add a string tokenizer
add(tokenizer);
|
public void | addTrim(org.apache.tools.ant.filters.TokenFilter$Trim filter)trim filter
filters.addElement(filter);
|
public final java.io.Reader | chain(java.io.Reader reader)Creates a new TokenFilter using the passed in
Reader for instantiation.
TokenFilter newFilter = new TokenFilter(reader);
newFilter.filters = filters;
newFilter.tokenizer = tokenizer;
newFilter.delimOutput = delimOutput;
newFilter.setProject(getProject());
return newFilter;
|
public static int | convertRegexOptions(java.lang.String flags)convert regex option flag characters to regex options
g - Regexp.REPLACE_ALL
i - Regexp.MATCH_CASE_INSENSITIVE
m - Regexp.MATCH_MULTILINE
s - Regexp.MATCH_SINGLELINE
if (flags == null) {
return 0;
}
int options = 0;
if (flags.indexOf('g") != -1) {
options |= Regexp.REPLACE_ALL;
}
if (flags.indexOf('i") != -1) {
options |= Regexp.MATCH_CASE_INSENSITIVE;
}
if (flags.indexOf('m") != -1) {
options |= Regexp.MATCH_MULTILINE;
}
if (flags.indexOf('s") != -1) {
options |= Regexp.MATCH_SINGLELINE;
}
return options;
|
public int | read()Returns the next character in the filtered stream, only including
lines from the original stream which match all of the specified
regular expressions.
if (tokenizer == null) {
tokenizer = new LineTokenizer();
}
while (line == null || line.length() == 0) {
line = tokenizer.getToken(in);
if (line == null) {
return -1;
}
for (Enumeration e = filters.elements(); e.hasMoreElements();) {
Filter filter = (Filter) e.nextElement();
line = filter.filter(line);
if (line == null) {
break;
}
}
linePos = 0;
if (line != null) {
if (tokenizer.getPostToken().length() != 0) {
if (delimOutput != null) {
line = line + delimOutput;
} else {
line = line + tokenizer.getPostToken();
}
}
}
}
int ch = line.charAt(linePos);
linePos++;
if (linePos == line.length()) {
line = null;
}
return ch;
|
public static java.lang.String | resolveBackSlash(java.lang.String input)xml does not do "c" like interpretation of strings.
i.e. \n\r\t etc.
this method processes \n, \r, \t, \f, \\
also subs \s -> " \n\r\t\f"
a trailing '\' will be ignored
return StringUtils.resolveBackSlash(input);
|
public void | setDelimOutput(java.lang.String delimOutput)set the output delimiter.
this.delimOutput = resolveBackSlash(delimOutput);
|