com.jmw.tzap.filters
Class InsertReferenceFilter

java.lang.Object
  extended by com.jmw.tzap.AbstractFilter
      extended by com.jmw.tzap.filters.InsertReferenceFilter

public class InsertReferenceFilter
extends AbstractFilter

Replaces a series of file name reference in a buffer


Field Summary
protected  java.lang.StringBuffer buff
           
protected  java.lang.String file
           
protected  int fileCount
           
protected  FilterFile[] files
           
protected  java.lang.String nextDefault
           
protected  Sequencer orderer
           
protected  java.lang.String prevDefault
           
 
Fields inherited from class com.jmw.tzap.AbstractFilter
encoding, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, task
 
Constructor Summary
InsertReferenceFilter()
           
 
Method Summary
 void add(Sequencer orderer)
          Sets the Sequencer.
 java.lang.StringBuffer doFilter(java.lang.StringBuffer sb, java.lang.String fn)
           
 FilterFile[] execute(FilterFile[] ffs)
          Processes all FilterFiles that this filter is supposed to filter.
 void load()
          Does any initilaztion of the filter before it can be used.
 void setNextDefault(java.lang.String nextDefault)
          Sets the default to use for the last file when next no longer is valid
 void setPrevDefault(java.lang.String prevDefault)
          Sets the default to use for the first file when previous is not valid
 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.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

fileCount

protected int fileCount

buff

protected java.lang.StringBuffer buff

file

protected java.lang.String file

orderer

protected Sequencer orderer

files

protected FilterFile[] files

nextDefault

protected java.lang.String nextDefault

prevDefault

protected java.lang.String prevDefault
Constructor Detail

InsertReferenceFilter

public InsertReferenceFilter()
Method Detail

load

public void load()
Description copied from class: AbstractFilter
Does any initilaztion of the filter before it can be used. Note; Only called once, before any filters are run.

Specified by:
load in class AbstractFilter

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.

Specified by:
unload in class AbstractFilter

execute

public FilterFile[] execute(FilterFile[] ffs)
                     throws java.lang.Exception
Description copied from class: AbstractFilter
Processes all FilterFiles that this filter is supposed to filter.

Specified by:
execute in class AbstractFilter
Parameters:
ffs - the FilterFiles that are to be filtered
Returns:
the filtered files
Throws:
java.lang.Exception - if something goes wrong during processing

doFilter

public java.lang.StringBuffer doFilter(java.lang.StringBuffer sb,
                                       java.lang.String fn)

add

public void add(Sequencer orderer)
Sets the Sequencer.

Parameters:
orderer - the orderer to be used

setPrevDefault

public void setPrevDefault(java.lang.String prevDefault)
Sets the default to use for the first file when previous is not valid

Parameters:
prevDefault - the default value

setNextDefault

public void setNextDefault(java.lang.String nextDefault)
Sets the default to use for the last file when next no longer is valid

Parameters:
nextDefault - the default value

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