|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jmw.tzap.AbstractFilter com.jmw.tzap.IteratingFilter com.jmw.tzap.filters.ReplaceListFilter
public class ReplaceListFilter
Replaces all regex and match pairs found in the matchfile.
The match file must be structured like a properties file.
For example:
abc=123 M(.)*=Moose [a-z]=Z$1Any line that begins with a # will be ignored. Optionally a prefix and or suffix may be added to each regex.
Field Summary | |
---|---|
protected java.lang.String |
matchFile
|
protected java.lang.String |
prefix
|
protected java.lang.String |
suffix
|
Fields inherited from class com.jmw.tzap.AbstractFilter |
---|
encoding, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, task |
Constructor Summary | |
---|---|
ReplaceListFilter()
|
Method Summary | |
---|---|
java.lang.StringBuffer |
doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
Does the actual filtering. |
void |
load()
Loads the list of regex's from the specified file. |
void |
setMatchFile(java.lang.String matchFile)
Sets the matchfile that contains the regex's |
void |
setPrefix(java.lang.String prefix)
Sets the regex prefix that will be appended to each regex in the matchfile. |
void |
setSuffix(java.lang.String suffix)
Sets the regex suffix that will be appended to each regex in the matchfile. |
void |
unload()
Does any clean up after the filter has been finished. |
void |
validateParameters()
Validates any parameters needed by the child filters. |
Methods inherited from class com.jmw.tzap.IteratingFilter |
---|
execute |
Methods inherited from class com.jmw.tzap.AbstractFilter |
---|
getName, log, log, setEncoding, setTask |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String matchFile
protected java.lang.String prefix
protected java.lang.String suffix
Constructor Detail |
---|
public ReplaceListFilter()
Method Detail |
---|
public void load()
load
in class IteratingFilter
public void unload()
AbstractFilter
unload
in class IteratingFilter
public java.lang.StringBuffer doFilter(java.lang.StringBuffer sb, java.lang.String fileName)
IteratingFilter
doFilter
in class IteratingFilter
sb
- the file to be filtered as a StringBufferfileName
- the name that this file is called on disk
public void validateParameters() throws java.lang.Exception
AbstractFilter
validateParameters
in class AbstractFilter
java.lang.Exception
public void setMatchFile(java.lang.String matchFile)
matchfile
- the name of the matchfilepublic void setPrefix(java.lang.String prefix)
prefix
- the prefix to appendpublic void setSuffix(java.lang.String suffix)
suffix
- the suffix to append
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |