public CodeReaderConfiguration cloneWithoutCodeReaderFilters() { CodeReaderConfiguration clone = new CodeReaderConfiguration(); clone.setTabWidth(tabWidth); return clone; }
/** * Note that this constructor will read everything from reader and will close it. */ protected CodeBuffer(Reader initialCodeReader, CodeReaderConfiguration configuration) { Reader reader = null; try { lastChar = -1; cursor = new Cursor(); tabWidth = configuration.getTabWidth(); /* Setup the filters on the reader */ reader = initialCodeReader; for (CodeReaderFilter<?> codeReaderFilter : configuration.getCodeReaderFilters()) { reader = new Filter(reader, codeReaderFilter, configuration); } buffer = IOUtils.toCharArray(reader); } catch (IOException e) { throw new ChannelException(e.getMessage(), e); } finally { IOUtils.closeQuietly(reader); } }
public CodeReader(Reader code) { super(code, new CodeReaderConfiguration()); }
public Filter(Reader in, CodeReaderFilter<?> codeReaderFilter, CodeReaderConfiguration configuration) { super(in); this.codeReaderFilter = codeReaderFilter; this.codeReaderFilter.setConfiguration(configuration.cloneWithoutCodeReaderFilters()); this.codeReaderFilter.setReader(in); }
public CodeReader(String code) { super(code, new CodeReaderConfiguration()); }