Package 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
For ReaderSources that can choose a parent class, a base that
 provides common functionality.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if the source can be restarted (i.e.voidcleanup()Cleans up any cached resources used by getLine().Returns a line from the source, or null, if unavailable.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.groovy.control.io.ReaderSourcegetReader, getURI
- 
Field Details- 
configuration
 
- 
- 
Constructor Details- 
AbstractReaderSource
 
- 
- 
Method Details- 
canReopenSourcepublic boolean canReopenSource()Returns true if the source can be restarted (i.e. if getReader() will return non-null on subsequent calls).- Specified by:
- canReopenSourcein interface- ReaderSource
- Returns:
- true if the resource can be reopened for reading
 
- 
getLineReturns a line from the source, or null, if unavailable. If you supply a Janitor, resources will be cached.- Specified by:
- getLinein interface- ReaderSource
- Parameters:
- lineNumber- the number of the line of interest
- janitor- helper to clean up afterwards
- Returns:
- the line of interest
 
- 
cleanuppublic void cleanup()Cleans up any cached resources used by getLine().- Specified by:
- cleanupin interface- HasCleanup
- Specified by:
- cleanupin interface- ReaderSource
 
 
-