class FilteredChannelOutputWrapper extends ChannelOutputWrapper implements FilteredChannelOutput
| Modifier and Type | Field and Description |
|---|---|
private FilterHolder |
filters
Set of write filters installed.
|
| Constructor and Description |
|---|
FilteredChannelOutputWrapper(ChannelOutput out)
Constructs a new
FilteredChannelOutputWrapper around the given output channel end. |
| Modifier and Type | Method and Description |
|---|---|
void |
addWriteFilter(Filter filter)
Installs a write filter defining a transformation to be applied by the
write method of
the channel end. |
void |
addWriteFilter(Filter filter,
int index)
Installs a write filter defining a transformation to be applied by the
write method of the
channel end at a specific index. |
Filter |
getWriteFilter(int index)
Returns the write filter installed at the given index.
|
int |
getWriteFilterCount()
Returns the number of write filters currently installed.
|
void |
removeWriteFilter(Filter filter)
Removes the first write filter (lowest index) matching the filter given as a parameter.
|
void |
removeWriteFilter(int index)
Removes the write filter installed at the given index.
|
void |
write(java.lang.Object data)
Writes a value to the channel.
|
poisonclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpoisonprivate FilterHolder filters
public FilteredChannelOutputWrapper(ChannelOutput out)
FilteredChannelOutputWrapper around the given output channel end.out - the existing output channel.public void write(java.lang.Object data)
ChannelOutputWrapperwrite in interface ChannelOutputwrite in class ChannelOutputWrapperdata - the value to write.ChannelOutputpublic void addWriteFilter(Filter filter)
WriteFilteredwrite method of
the channel end. The filter will be appended to the end of the current list, making it the last to
be applied.addWriteFilter in interface WriteFilteredfilter - the filter to be installed; may not be null.public void addWriteFilter(Filter filter, int index)
WriteFilteredwrite method of the
channel end at a specific index. If there is already a filter at that index position the existing
filters are shifted to make room. If the index is greater than the number of filters already
installed the filter is placed at the end.addWriteFilter in interface WriteFilteredfilter - the filter to be installed; may not be null.index - the zero based index; may not be negative.public void removeWriteFilter(Filter filter)
WriteFilteredr, will satisfy the condition r.equals (filter). The remaining
filters are shifted to close the gap in the index allocation.removeWriteFilter in interface WriteFilteredfilter - the filter to be removed; may not be null.public void removeWriteFilter(int index)
WriteFilteredremoveWriteFilter in interface WriteFilteredindex - zero-based index of the filter to be removed.public Filter getWriteFilter(int index)
WriteFilteredgetWriteFilter in interface WriteFilteredindex - zero-based index of the filter to return.public int getWriteFilterCount()
WriteFilteredgetWriteFilterCount in interface WriteFiltered