com.jmw.tzap.filters
Class FindFilter
java.lang.Object
com.jmw.tzap.AbstractFilter
com.jmw.tzap.IteratingFilter
com.jmw.tzap.filters.FindFilter
- Direct Known Subclasses:
- FindMergeFilter
public class FindFilter
- extends IteratingFilter
FindFilter searches for all occurances of a given Regex and can save
the list in a file.
Field Summary |
protected int |
count
|
protected int |
fileCount
|
protected java.lang.String |
outFile
|
protected java.util.regex.Pattern |
pattern
|
protected java.util.Set<java.lang.String> |
set
|
Method Summary |
java.lang.StringBuffer |
doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
Does the actual filtering. |
void |
setOutFile(java.lang.String outfile)
Sets the name of the output file that the found values should be
placed into |
void |
setRegex(java.lang.String regex)
Sets the regex to search for |
void |
unload()
Saves the found regex values into a file if a filename was supplied. |
void |
validateParameters()
Validates any parameters needed by the child filters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pattern
protected java.util.regex.Pattern pattern
count
protected int count
fileCount
protected int fileCount
outFile
protected java.lang.String outFile
set
protected java.util.Set<java.lang.String> set
FindFilter
public FindFilter()
unload
public void unload()
- Saves the found regex values into a file if a filename was supplied.
- Overrides:
unload
in class IteratingFilter
doFilter
public java.lang.StringBuffer doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
- Description copied from class:
IteratingFilter
- Does the actual filtering.
- Specified by:
doFilter
in class IteratingFilter
- Parameters:
sb
- the file to be filtered as a StringBufferfileName
- the name that this file is called on disk
- Returns:
- the filtered file as a StringBuffer
validateParameters
public void validateParameters()
throws java.lang.Exception
- Description copied from class:
AbstractFilter
- Validates any parameters needed by the child filters.
- Specified by:
validateParameters
in class AbstractFilter
- Throws:
java.lang.Exception
setRegex
public void setRegex(java.lang.String regex)
- Sets the regex to search for
- Parameters:
regex
- the regular expression to search for
setOutFile
public void setOutFile(java.lang.String outfile)
- Sets the name of the output file that the found values should be
placed into
- Parameters:
outfile
- the name of the output file