de.spieleck.app.jacson.filter
Class HeadPadFilter
java.lang.Object
de.spieleck.app.jacson.PluginBase
de.spieleck.app.jacson.filter.FilterBase
de.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
HeadPadFilter
public HeadPadFilter()
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
Copyleft 2002 spieleck.de.