Package com.day.cq.dam.commons.handler
Class AbstractFilter
java.lang.Object
com.day.cq.dam.commons.handler.AbstractFilter
- All Implemented Interfaces:
Filter
- Direct Known Subclasses:
XPacketFilter
Continuously filter bytes and produce an output that can be read
back. Optionally pass processed bytes to a next filter.
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidfilter(byte[] buf, int off, int len) Filter a couple of bytes.booleanisValid()Return a flag indicating whether the contents processed by this filter represents a valid entity.final voidreset()Reset the filter.voidsetAutoReset(boolean autoReset) Set the flag indicating whether the filter automatically resets its internal state when the end marker has been read.voidsetFilterStateListener(FilterStateListener listener) Set a filter state listener.
-
Method Details
-
setFilterStateListener
Set a filter state listener.- Parameters:
listener- listener
-
filter
Filter a couple of bytes.- Specified by:
filterin interfaceFilter- Parameters:
buf- bufferoff- offset inside bufferlen- number of bytes- Throws:
IOException
-
reset
public final void reset()Reset the filter. -
setAutoReset
public void setAutoReset(boolean autoReset) Set the flag indicating whether the filter automatically resets its internal state when the end marker has been read.- Specified by:
setAutoResetin interfaceFilter- Parameters:
autoReset- autoReset
-
isValid
public boolean isValid()Return a flag indicating whether the contents processed by this filter represents a valid entity. This implementation returnstrue.
-