com.jmw.tzap.filters
Class AppendFilter
java.lang.Object
com.jmw.tzap.AbstractFilter
com.jmw.tzap.IteratingFilter
com.jmw.tzap.filters.AppendFilter
public class AppendFilter
- extends IteratingFilter
Appends text to the beginning or end of a buffer.
Field Summary |
protected java.lang.String |
append
|
protected boolean |
atEnd
|
Method Summary |
java.lang.StringBuffer |
doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
Does the actual filtering. |
void |
setAppend(java.lang.String s)
Sets the string that will be appended. |
void |
setAtEnd(boolean atEnd)
Sets the at end flag which indicates whether or not
the append string is added at the end or the beginning. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
atEnd
protected boolean atEnd
append
protected java.lang.String append
AppendFilter
public AppendFilter()
unload
public void unload()
- Description copied from class:
AbstractFilter
- Does any clean up after the filter has been finished.
Note; Only called once, when all files have been filtered.
- 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
setAppend
public void setAppend(java.lang.String s)
- Sets the string that will be appended.
- Parameters:
s
- the string to be appended
setAtEnd
public void setAtEnd(boolean atEnd)
- Sets the at end flag which indicates whether or not
the append string is added at the end or the beginning.
- Parameters:
atEnd
- the at end flag