Top Description Fields Constructors Methods
groovy.io

public Class GroovyPrintWriter

extends PrintWriter
Class Inheritance
Imports
org.codehaus.groovy.runtime.InvokerHelper, java.io.File, .FileNotFoundException, .OutputStream, .PrintWriter, .UnsupportedEncodingException, .Writer

A PrintWriter that outputs objects in Groovy style. That means print(Object) uses InvokerHelper.toString(Object) to produce the same results as Writer.print(Object).
Since
1.6

Field Summary

Inherited from java.io.PrintWriter:
out

Constructor Summary

AccessConstructor and Description
public
public
public
public
GroovyPrintWriter(Writer out, boolean autoflush)

public
public
GroovyPrintWriter(OutputStream out, boolean autoflush)

public
public

Method Summary

Modifier and TypeMethod and Description
public void
println(Object
The Object to be printed.
x
)

Overrides java.io.PrintWriter.println.

Prints an Object and then terminates the line.
Inherited from java.io.PrintWriter:
appendappendappendcheckErrorclearErrorcloseflushformatformatprintprintprintprintprintprintprintprintprintfprintfprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnsetErrorwritewritewritewritewrite

Constructor Detail

GroovyPrintWriterback to summary
public GroovyPrintWriter(File file) throws FileNotFoundException
GroovyPrintWriterback to summary
public GroovyPrintWriter(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException
GroovyPrintWriterback to summary
public GroovyPrintWriter(Writer out)
GroovyPrintWriterback to summary
public GroovyPrintWriter(Writer out, boolean autoflush)
GroovyPrintWriterback to summary
public GroovyPrintWriter(OutputStream out)
GroovyPrintWriterback to summary
public GroovyPrintWriter(OutputStream out, boolean autoflush)
GroovyPrintWriterback to summary
public GroovyPrintWriter(String filename) throws FileNotFoundException
GroovyPrintWriterback to summary
public GroovyPrintWriter(String filename, String csn) throws FileNotFoundException, UnsupportedEncodingException

Method Detail

printlnback to summary
public void println(Object x)

Overrides java.io.PrintWriter.println.

Doc from java.io.PrintWriter.println.

Prints an Object and then terminates the line. This method calls at first String.valueOf(x) to get the printed object's string value, then behaves as though it invokes print(String) and then println().

Parameters
x:Object

The Object to be printed.