|
||||||||||
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.ReplaceFilterPlus
public abstract class ReplaceFilterPlus
Abstract filter that allows some work to be done to part of a
regex before replacement.
This filter divides the supplied regex into three user supplied groups.
Field Summary | |
---|---|
protected java.util.regex.Matcher |
matcher
|
protected int |
modifyGroup
|
protected java.util.regex.Pattern |
pattern
|
protected int |
postGroup
|
protected int |
preGroup
|
Fields inherited from class com.jmw.tzap.AbstractFilter |
---|
encoding, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, task |
Constructor Summary | |
---|---|
ReplaceFilterPlus()
|
Method Summary | |
---|---|
java.lang.StringBuffer |
doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
Does the actual filtering. |
void |
load()
Does any initilaztion of the filter before it can be used. |
protected abstract java.lang.String |
modifiedReplacment()
|
void |
setModifyGroup(int g)
Sets the group that will be modified by the classes that extend ReplaceFilterPlus. |
void |
setPostGroup(int g)
Sets the group that will be inserted after the midified group. |
void |
setPreGroup(int g)
Sets the group that will be inserted before the midified group. |
void |
setRegex(java.lang.String regexp)
Sets the regular expression to be replaced. |
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.util.regex.Pattern pattern
protected int modifyGroup
protected int preGroup
protected int postGroup
protected java.util.regex.Matcher matcher
Constructor Detail |
---|
public ReplaceFilterPlus()
Method Detail |
---|
public void load()
AbstractFilter
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
protected abstract java.lang.String modifiedReplacment()
public void validateParameters() throws java.lang.Exception
AbstractFilter
validateParameters
in class AbstractFilter
java.lang.Exception
public void setRegex(java.lang.String regexp)
regex
- the regexpublic void setModifyGroup(int g)
g
- the group numberpublic void setPreGroup(int g)
g
- the group numberpublic void setPostGroup(int g)
g
- the group number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |