com.jmw.tzap.filters
Class AppendFilter

java.lang.Object
  extended by com.jmw.tzap.AbstractFilter
      extended by com.jmw.tzap.IteratingFilter
          extended by 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
           
 
Fields inherited from class com.jmw.tzap.AbstractFilter
encoding, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, task
 
Constructor Summary
AppendFilter()
           
 
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 com.jmw.tzap.IteratingFilter
execute, load
 
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

atEnd

protected boolean atEnd

append

protected java.lang.String append
Constructor Detail

AppendFilter

public AppendFilter()
Method Detail

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 StringBuffer
fileName - 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