Jacson

de.spieleck.app.jacson.filter
Class HeadPadFilter

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

public class HeadPadFilter
extends FilterBase
implements FilterNames, ConfigVerify.Acceptor

HeadPadFilter

Description

Filter class which either adds a configurable token as first chunk or prepends the token to the first chunk. This allows something like awk's begin.

Parameters

Attribute Description Required
pre The token to add at the beginning Yes
separatechunk Determines if the token is added as separated chunk or if the token is prepended to the first chunk No, default is false

Since:
0.90
Version:
$Id: HeadPadFilter.java 35 2005-10-03 22:08:55Z pcs $
Author:
pcs

Field Summary
static java.lang.String PRE_NODE
           
static boolean SEPARATE_CHUNK_DEFAULT
           
static java.lang.String SEPARATE_CHUNK_NODE
           
 
Fields inherited from class de.spieleck.app.jacson.filter.FilterBase
drain
 
Fields inherited from interface de.spieleck.app.jacson.filter.FilterNames
COUNT_NODE, INVERSE_NODE
 
Constructor Summary
HeadPadFilter()
           
 
Method Summary
 boolean accept(ConfigNode node)
           
 void init(ConfigNode snr, JacsonRegistry registry)
          string to add is configured via node "pre"
 void putChunk(java.lang.String ch)
          adds the configured text to the first chunk
 
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

PRE_NODE

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

SEPARATE_CHUNK_NODE

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

SEPARATE_CHUNK_DEFAULT

public static final boolean SEPARATE_CHUNK_DEFAULT
See Also:
Constant Field Values
Constructor Detail

HeadPadFilter

public HeadPadFilter()
Method Detail

init

public void init(ConfigNode snr,
                 JacsonRegistry registry)
          throws JacsonConfigException
string to add is configured via node "pre"

Specified by:
init in interface JacsonRegistrable
Throws:
JacsonConfigException

putChunk

public void putChunk(java.lang.String ch)
              throws JacsonException
adds the configured text to the first chunk

Specified by:
putChunk in interface JacsonChunkDrain
Throws:
JacsonException

accept

public boolean accept(ConfigNode node)
Specified by:
accept in interface ConfigVerify.Acceptor

Spieleck

Copyleft 2002 spieleck.de.