Jacson

de.spieleck.app.jacson.filter
Class FileInsertFilter

java.lang.Object
  extended byde.spieleck.app.jacson.PluginBase
      extended byde.spieleck.app.jacson.filter.FilterBase
          extended byde.spieleck.app.jacson.filter.FileInsertFilter
All Implemented Interfaces:
ConfigVerify.Acceptor, JacsonChunkDrain, JacsonFilter, JacsonRegistrable, JacsonReporting, JacsonStately

public class FileInsertFilter
extends FilterBase
implements ConfigVerify.Acceptor

Filter to look up lines from a file.

Author:
brenck (Dirk.Brenckmann -at- gmx.de ), fsn

Field Summary
static java.lang.String EVAL_NODE
           
protected  java.lang.String file
          File to access
static java.lang.String FILE_NODE
           
protected  boolean lazyEval
          Evaluation type
protected  java.lang.String line
          Line to access
static java.lang.String LINE_NODE
           
static java.lang.String USEONNULL_NODE
           
protected  boolean useOnNullChunks
          Is the filter to be used on "null"-chunks?
 
Fields inherited from class de.spieleck.app.jacson.filter.FilterBase
drain
 
Constructor Summary
FileInsertFilter()
          Default constructor.
 
Method Summary
 boolean accept(ConfigNode node)
          Overwritten accept method.
 java.lang.String getLine(java.lang.String filename, java.lang.String linenumber)
           
 void init(ConfigNode config, JacsonRegistry registry)
          Overwritten init method.
 void putChunk(java.lang.String chunk)
          Replace chunk by something found in a file.
protected  java.lang.String tryExpand(java.lang.String val, boolean lazy)
          Lazy or non lazy evaluation of value.
 
Methods inherited from class de.spieleck.app.jacson.filter.FilterBase
setDrain
 
Methods inherited from class de.spieleck.app.jacson.PluginBase
getRegReport, getRegState, registerReport, registerState, summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.spieleck.app.jacson.JacsonStately
registerState
 
Methods inherited from interface de.spieleck.app.jacson.JacsonReporting
registerReport, summary
 

Field Detail

EVAL_NODE

public static final java.lang.String EVAL_NODE
See Also:
Constant Field Values

LINE_NODE

public static final java.lang.String LINE_NODE
See Also:
Constant Field Values

FILE_NODE

public static final java.lang.String FILE_NODE
See Also:
Constant Field Values

USEONNULL_NODE

public static final java.lang.String USEONNULL_NODE
See Also:
Constant Field Values

useOnNullChunks

protected boolean useOnNullChunks
Is the filter to be used on "null"-chunks?


lazyEval

protected boolean lazyEval
Evaluation type


line

protected java.lang.String line
Line to access


file

protected java.lang.String file
File to access

Constructor Detail

FileInsertFilter

public FileInsertFilter()
Default constructor. Ensure it's existence.

Method Detail

init

public void init(ConfigNode config,
                 JacsonRegistry registry)
          throws JacsonConfigException
Overwritten init method. Called first and only once in initialization process.

Specified by:
init in interface JacsonRegistrable
Throws:
JacsonConfigException

accept

public boolean accept(ConfigNode node)
Overwritten accept method. Called only once and after the call to init. (You can skip this by removing ConfigUtil.verify() from init())

Specified by:
accept in interface ConfigVerify.Acceptor

putChunk

public void putChunk(java.lang.String chunk)
              throws JacsonException
Replace chunk by something found in a file.

Specified by:
putChunk in interface JacsonChunkDrain
Throws:
JacsonException

getLine

public java.lang.String getLine(java.lang.String filename,
                                java.lang.String linenumber)

tryExpand

protected java.lang.String tryExpand(java.lang.String val,
                                     boolean lazy)
Lazy or non lazy evaluation of value.

Parameters:
val - the value to be expanded or not
lazy - true means the value needs expanding

Spieleck

Copyleft 2002 spieleck.de.