Jacson

de.spieleck.app.jacson.filter
Class PadFilter

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

public class PadFilter
extends FilterBase
implements ConfigVerify.Acceptor

Filter to pad a chunk. That is the chunk gets a prefix and postfix attached.

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

Field Summary
static java.lang.String EVAL_INITTIME
           
static java.lang.String EVAL_RUNTIME
          log4j logger - debugging is lame :-)
protected  boolean lazyPostEval
          Evaluationtype info of postfix
protected  boolean lazyPreEval
          Evaluationtype info of prefix
protected  java.lang.String post
          Argument or value used as padding postfix
static java.lang.String POST_EVAL
           
static java.lang.String POST_NODE
           
protected  java.lang.String pre
          Argument or value used as padding prefix
static java.lang.String PRE_EVAL
           
static java.lang.String PRE_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
PadFilter()
          Default constructor.
 
Method Summary
 boolean accept(ConfigNode node)
          Overwritten accept method.
 void init(ConfigNode config, JacsonRegistry registry)
          Overwritten init method.
protected static boolean obtainLazyness(ConfigNode config, java.lang.String name)
           
protected static java.lang.String obtainXFix(ConfigNode config, java.lang.String name, boolean lazy)
           
 void putChunk(java.lang.String chunk)
          Overwritten putChunk method.
protected  java.lang.String tryExpand(java.lang.String val, boolean lazy)
           
static java.lang.String tryExpand(java.lang.String val, boolean lazy, JacsonState st)
           
 
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_RUNTIME

public static final java.lang.String EVAL_RUNTIME
log4j logger - debugging is lame :-)

See Also:
Constant Field Values

EVAL_INITTIME

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

PRE_EVAL

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

POST_EVAL

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

PRE_NODE

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

POST_NODE

public static final java.lang.String POST_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?


pre

protected java.lang.String pre
Argument or value used as padding prefix


post

protected java.lang.String post
Argument or value used as padding postfix


lazyPreEval

protected boolean lazyPreEval
Evaluationtype info of prefix


lazyPostEval

protected boolean lazyPostEval
Evaluationtype info of postfix

Constructor Detail

PadFilter

public PadFilter()
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

obtainLazyness

protected static boolean obtainLazyness(ConfigNode config,
                                        java.lang.String name)

obtainXFix

protected static java.lang.String obtainXFix(ConfigNode config,
                                             java.lang.String name,
                                             boolean lazy)

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
Overwritten putChunk method. Called whenever data is to be filtered. This method MODIFIES the incoming passes the

Specified by:
putChunk in interface JacsonChunkDrain
Throws:
JacsonException

tryExpand

protected java.lang.String tryExpand(java.lang.String val,
                                     boolean lazy)

tryExpand

public static java.lang.String tryExpand(java.lang.String val,
                                         boolean lazy,
                                         JacsonState st)

Spieleck

Copyleft 2002 spieleck.de.