public final class ChannelCodeReaderFilter<OUTPUT> extends CodeReaderFilter<OUTPUT>
Constructor and Description |
---|
ChannelCodeReaderFilter(Channel<OUTPUT>... channels)
Creates a CodeReaderFilter that will use the provided Channels to filter the character stream it gets from its reader.
|
ChannelCodeReaderFilter(OUTPUT output,
Channel<OUTPUT>... channels)
Creates a CodeReaderFilter that will use the provided Channels to filter the character stream it gets from its reader.
|
Modifier and Type | Method and Description |
---|---|
int |
read(char[] filteredBuffer,
int offset,
int length)
This method implements the filtering logic, that is:
get the characters from the reader,
filter the character flow (and grab more characters from the reader if the filtering removes some),
and fill the given buffer to its full capacity with the filtered data.
|
void |
setReader(Reader reader)
Sets the reader from which this class will read the character stream.
|
getConfiguration, getOutput, getReader, setConfiguration, setOutput
public ChannelCodeReaderFilter(Channel<OUTPUT>... channels)
channels
- the different channelspublic ChannelCodeReaderFilter(OUTPUT output, Channel<OUTPUT>... channels)
output
- the object that may accept tokenschannels
- the different channelspublic void setReader(Reader reader)
setReader
in class CodeReaderFilter<OUTPUT>
reader
- the readerpublic int read(char[] filteredBuffer, int offset, int length) throws IOException
read
in class CodeReaderFilter<OUTPUT>
filteredBuffer
- the output buffer that must contain the filtered dataoffset
- the offset to start reading from the readerlength
- the number of characters to read from the readerIOException
- If an I/O error occursCopyright © 2009-2012 SonarSource. All Rights Reserved.