org.codehaus.groovy.control.io
Class AbstractReaderSource
java.lang.Object
org.codehaus.groovy.control.io.AbstractReaderSource
- All Implemented Interfaces:
- HasCleanup, ReaderSource
- Direct Known Subclasses:
- FileReaderSource, InputStreamReaderSource, StringReaderSource, URLReaderSource
- public abstract class AbstractReaderSource
- extends java.lang.Object
- implements ReaderSource
For ReaderSources that can choose a parent class, a base that
provides common functionality.
- Version:
- $Id: AbstractReaderSource.java,v 1.1 2004/04/19 07:29:44 cpoirier Exp $
- Author:
- Chris Poirier
Method Summary |
boolean |
canReopenSource()
Returns true if the source can be restarted (ie. |
void |
cleanup()
Cleans up any cached resources used by getLine(). |
java.lang.String |
getLine(int lineNumber,
Janitor janitor)
Returns a line from the source, or null, if unavailable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
configuration
protected CompilerConfiguration configuration
lineSource
private java.io.BufferedReader lineSource
line
private java.lang.String line
number
private int number
AbstractReaderSource
public AbstractReaderSource(CompilerConfiguration configuration)
- Standard construction stuff.
canReopenSource
public boolean canReopenSource()
- Returns true if the source can be restarted (ie. if getReader()
will return non-null on subsequent calls.
- Specified by:
canReopenSource
in interface ReaderSource
getLine
public java.lang.String getLine(int lineNumber,
Janitor janitor)
- Returns a line from the source, or null, if unavailable. If
you supply a Janitor, resources will be cached.
- Specified by:
getLine
in interface ReaderSource
cleanup
public void cleanup()
- Cleans up any cached resources used by getLine().
- Specified by:
cleanup
in interface ReaderSource
Copyright © 2003-2005 The Codehaus. All Rights Reserved.