|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.channel.CodeReaderFilter<OUTPUT>
public abstract class CodeReaderFilter<OUTPUT>
This class can be extended to provide filtering capabilities for the CodeReader class.
The purpose is to filter the character flow before the CodeReader class passes it to the different channels. It is possible to give
several filters to a CodeReader: they will be called one after another, following the declaration order in the CodeReader constructor, to
sequentially filter the character flow.
CodeReader
,
CodeBufferTest#testCodeReaderFilter()
,
CodeBufferTest#testSeveralCodeReaderFilter()
Constructor Summary | |
---|---|
CodeReaderFilter()
|
|
CodeReaderFilter(OUTPUT output)
|
Method Summary | |
---|---|
CodeReaderConfiguration |
getConfiguration()
Returns the configuration used for the CodeReader |
OUTPUT |
getOutput()
Returns the output object. |
Reader |
getReader()
Returns the reader from which this class reads the character stream. |
abstract 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 |
setConfiguration(CodeReaderConfiguration configuration)
Sets the configuration that must be used by the CodeReader |
void |
setOutput(OUTPUT output)
Sets the output object |
void |
setReader(Reader reader)
Sets the reader from which this class will read the character stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CodeReaderFilter()
public CodeReaderFilter(OUTPUT output)
Method Detail |
---|
public Reader getReader()
public void setReader(Reader reader)
reader
- the readerpublic OUTPUT getOutput()
public void setOutput(OUTPUT output)
output
- the output to setpublic CodeReaderConfiguration getConfiguration()
public void setConfiguration(CodeReaderConfiguration configuration)
configuration
- the configuration to setpublic abstract int read(char[] filteredBuffer, int offset, int length) throws IOException
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 reader
IOException
- If an I/O error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |