| Method Summary | |
|---|---|
void
|
eachLine(groovy.lang.Closure closure)
Iterates through the given reader line by line |
void
|
filterLine(java.io.Writer writer, groovy.lang.Closure closure)
Filter the lines from a reader and write them on the writer, according to a closure which returns true or false |
groovy.lang.Writable
|
filterLine(groovy.lang.Closure closure)
Filter the lines of a Reader and create a Writable in return to stream the filtered lines |
java.lang.String
|
getText()
Reads the content of the Reader and returns it as a String |
java.util.Iterator
|
iterator()
|
java.lang.String
|
readLine()
Read a single, whole line from the given Reader |
java.util.List
|
readLines()
Reads the reader into a list of Strings for each line |
void
|
splitEachLine(java.lang.String sep, groovy.lang.Closure closure)
Iterates through the given reader line by line, splitting on the separator |
void
|
transformChar(java.io.Writer writer, groovy.lang.Closure closure)
Transforms the characters from a self with a Closure and writes them to a writer |
void
|
transformLine(java.io.Writer writer, groovy.lang.Closure closure)
Transforms the lines from a reader with a Closure and write them to a writer |
void
|
withReader(groovy.lang.Closure closure)
Allows a Reader to be used, calling the closure with the reader and then ensuring that the reader is closed down again irrespective of whether exceptions occur or the |
| Method Detail |
|---|
public void eachLine(groovy.lang.Closure closure)
closure - a closure.
public void filterLine(java.io.Writer writer, groovy.lang.Closure closure)
writer - a writer, closed after the call.
closure - the closure which returns booleans.
public groovy.lang.Writable filterLine(groovy.lang.Closure closure)
closure - a closure returning a boolean indicating to filter or not a line.
public java.lang.String getText()
public java.util.Iterator iterator()
public java.lang.String readLine()
public java.util.List readLines()
public void splitEachLine(java.lang.String sep, groovy.lang.Closure closure)
sep - a String separator.
closure - a closure.
public void transformChar(java.io.Writer writer, groovy.lang.Closure closure)
writer - a Writer to receive the transformed characters.
closure - a closure that performs the required transformation.
public void transformLine(java.io.Writer writer, groovy.lang.Closure closure)
writer - Where transformed lines are written. Writer is closed afterwards..
closure - Single parameter closure that is called to transform each line of text from the reader, before writing it to the writer..
public void withReader(groovy.lang.Closure closure)
closure - the closure that the writer is passed into.