com.jmw.tzap.filters
Class AppendFileFilter
java.lang.Object
com.jmw.tzap.AbstractFilter
com.jmw.tzap.IteratingFilter
com.jmw.tzap.filters.AppendFileFilter
public class AppendFileFilter
- extends IteratingFilter
Appends the contents of a file to the beginning or end of a buffer.
- Author:
- Judah Wischnitzer
Field Summary |
protected java.io.File |
appendFile
|
protected java.lang.String |
appendName
|
protected boolean |
atEnd
|
protected java.lang.StringBuffer |
text
|
Method Summary |
java.lang.StringBuffer |
doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
Description of the Method |
void |
setAppendFile(java.lang.String s)
Sets the name of the file 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()
unloads the filter |
void |
validateParameters()
Validates the parameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
atEnd
protected boolean atEnd
appendFile
protected java.io.File appendFile
appendName
protected java.lang.String appendName
text
protected java.lang.StringBuffer text
AppendFileFilter
public AppendFileFilter()
unload
public void unload()
- unloads the filter
- Overrides:
unload
in class IteratingFilter
doFilter
public java.lang.StringBuffer doFilter(java.lang.StringBuffer sb,
java.lang.String fileName)
- Description of the Method
- Specified by:
doFilter
in class IteratingFilter
- Parameters:
sb
- the buffer to be filteredfileName
- the name of the file that this buffer is from
- Returns:
- the filtered buffer
validateParameters
public void validateParameters()
throws java.lang.Exception
- Validates the parameters
- Specified by:
validateParameters
in class AbstractFilter
- Throws:
java.lang.Exception
- if the parameters are invalid
setAppendFile
public void setAppendFile(java.lang.String s)
- Sets the name of the file that will be appended.
- Parameters:
s
- the name of the file to be appended
- Throws:
java.io.FileNotFoundException
- if the append file is not found
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