| Modifier | Constructor and Description |
|---|---|
protected |
FilterAdapter()
The protected default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
afterAppend(StringBuilder buffer)
Invoked when the input string has just been appended to the input buffer.
|
String |
beforeAppend(String string,
StringBuilder buffer)
Invoked when a string read from the input is about to be appended to the input buffer.
|
protected boolean |
doAfterAppend(StringBuilder buffer)
Called if the filter is enabled.
|
protected String |
doBeforeAppend(String string,
StringBuilder buffer)
Called if the filter is enabled.
|
boolean |
isEnabled()
Indicates if the filter is enabled or disabled.
|
void |
setEnabled(boolean enabled)
Enables or disables the filter for the input.
|
public final String beforeAppend(String string, StringBuilder buffer)
FilterbeforeAppend in interface Filterstring - a chunk of input data read from the input stream. Can not be null.
If the filter
works in the Filters.chain(Filter...), then the string is the result
of preceding filterbuffer - the reference to the input buffer. Can be used to modify the entire buffer
contents.null to ignore all the
consequent filters in
the filter chain.protected String doBeforeAppend(String string, StringBuilder buffer)
beforeAppend(String,
StringBuilder)
method.
By default returns the given string.string - the input stringbuffer - the input bufferpublic final boolean afterAppend(StringBuilder buffer)
FilterafterAppend in interface Filterbuffer - the reference to the input buffer. Can be used to modify the entire buffer
contents.true if all the
consequent filters must not be executed, or false otherwise.protected boolean doAfterAppend(StringBuilder buffer)
(StringBuilder) method.buffer - the input bufferpublic final boolean isEnabled()
Filterpublic final void setEnabled(boolean enabled)
FiltersetEnabled in interface Filterenabled - if true then the filter will be enabled, or false otherwise.Copyright © 2014–2018 Alexey Gavrilov and contributors. All rights reserved.