Top Description Fields Constructors Methods
org.codehaus.groovy.control.io

public abstract Class AbstractReaderSource

extends Object
implements ReaderSource
Class Inheritance
All Implemented Interfaces
org.codehaus.groovy.control.io.ReaderSource, org.codehaus.groovy.control.HasCleanup
Known Direct Subclasses
org.codehaus.groovy.control.io.FileReaderSource, org.codehaus.groovy.control.io.InputStreamReaderSource, org.codehaus.groovy.control.io.StringReaderSource, org.codehaus.groovy.control.io.URLReaderSource
Imports
org.codehaus.groovy.control.CompilerConfiguration, .Janitor, java.io.BufferedReader, .IOException

For ReaderSources that can choose a parent class, a base that provides common functionality.

Field Summary

Modifier and TypeField and Description
protected CompilerConfiguration
private String
private BufferedReader
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canReopenSource()

Implements org.codehaus.groovy.control.io.ReaderSource.canReopenSource.

Returns true if the source can be restarted (ie.
public void
cleanup()

Implements org.codehaus.groovy.control.io.ReaderSource.cleanup.

Cleans up any cached resources used by getLine().
public String
getLine(int
the number of the line of interest
lineNumber
,
Janitor
helper to clean up afterwards
janitor
)

Implements org.codehaus.groovy.control.io.ReaderSource.getLine.

Returns a line from the source, or null, if unavailable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationback to summary
protected CompilerConfiguration configuration
lineback to summary
private String line
lineSourceback to summary
private BufferedReader lineSource
numberback to summary
private int number

Constructor Detail

AbstractReaderSourceback to summary
public AbstractReaderSource(final CompilerConfiguration configuration)

Method Detail

canReopenSourceback to summary
public boolean canReopenSource()

Implements org.codehaus.groovy.control.io.ReaderSource.canReopenSource.

Returns true if the source can be restarted (ie. if getReader() will return non-null on subsequent calls.

Returns:boolean

Doc from org.codehaus.groovy.control.io.ReaderSource.canReopenSource.

true if the resource can be reopened for reading

cleanupback to summary
public void cleanup()

Implements org.codehaus.groovy.control.io.ReaderSource.cleanup.

Cleans up any cached resources used by getLine().

getLineback to summary
public String getLine(int lineNumber, Janitor janitor)

Implements org.codehaus.groovy.control.io.ReaderSource.getLine.

Returns a line from the source, or null, if unavailable. If you supply a Janitor, resources will be cached.

Parameters
lineNumber:int

Doc from org.codehaus.groovy.control.io.ReaderSource.getLine.

the number of the line of interest

janitor:Janitor

Doc from org.codehaus.groovy.control.io.ReaderSource.getLine.

helper to clean up afterwards

Returns:String

Doc from org.codehaus.groovy.control.io.ReaderSource.getLine.

the line of interest