Top Description Inners Fields Constructors Methods
org.codehaus.groovy.tools.shell

public Class IO

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
org.codehaus.groovy.runtime.InvokerHelper, org.codehaus.groovy.tools.shell.util.Preferences, java.io.Closeable, .IOException, .InputStream, .InputStreamReader, .OutputStream, .PrintWriter, .Reader

Container for input/output handles.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
IO.Verbosity

Verbosity for simple logging: QUIET, INFO, VERBOSE, DEBUG

Field Summary

Modifier and TypeField and Description
private static final String
public final boolean
ansiSupported

Whether ansi support is available

public final PrintWriter
err

Preferred error output writer.

public final OutputStream
errorStream

Raw error output stream.

public final Reader
in

Preferred input reader.

public final InputStream
inputStream

Raw input stream.

public final PrintWriter
out

Preferred output writer.

public final OutputStream
outputStream

Raw output stream.

Constructor Summary

AccessConstructor and Description
public
IO(final InputStream inputStream, final OutputStream outputStream, final OutputStream errorStream)

Construct a new IO container.

public
IO()

Construct a new IO container using system streams.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Close all streams.
public void
flush()

Flush both output streams.

public IO.Verbosity
getVerbosity()

Returns the verbosity level.

public boolean
isDebug()

Check if the verbosity level is set to Verbosity#DEBUG.

public boolean
isInfo()

Check if the verbosity level is set to Verbosity#INFO.

public boolean
isQuiet()

Check if the verbosity level is set to Verbosity#QUIET.

public boolean
isVerbose()

Check if the verbosity level is set to Verbosity#VERBOSE.

public void
setVerbosity(final IO.Verbosity verbosity)

Set the verbosity level.

protected PrintWriter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANSI_RENDER_WRITERback to summary
private static final String ANSI_RENDER_WRITER
ansiSupportedback to summary
public final boolean ansiSupported

Whether ansi support is available

errback to summary
public final PrintWriter err

Preferred error output writer.

errorStreamback to summary
public final OutputStream errorStream

Raw error output stream.

inback to summary
public final Reader in

Preferred input reader.

inputStreamback to summary
public final InputStream inputStream

Raw input stream.

outback to summary
public final PrintWriter out

Preferred output writer.

outputStreamback to summary
public final OutputStream outputStream

Raw output stream.

Constructor Detail

IOback to summary
public IO(final InputStream inputStream, final OutputStream outputStream, final OutputStream errorStream)

Construct a new IO container.

IOback to summary
public IO()

Construct a new IO container using system streams.

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Close all streams.

Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

flushback to summary
public void flush()

Flush both output streams.

getVerbosityback to summary
public IO.Verbosity getVerbosity()

Returns the verbosity level.

isDebugback to summary
public boolean isDebug()

Check if the verbosity level is set to Verbosity#DEBUG.

For general usage, when debug output is required, it is better to use the logging facility instead.

isInfoback to summary
public boolean isInfo()

Check if the verbosity level is set to Verbosity#INFO.

isQuietback to summary
public boolean isQuiet()

Check if the verbosity level is set to Verbosity#QUIET.

isVerboseback to summary
public boolean isVerbose()

Check if the verbosity level is set to Verbosity#VERBOSE.

setVerbosityback to summary
public void setVerbosity(final IO.Verbosity verbosity)

Set the verbosity level.

tryConstructRenderWriterback to summary
protected PrintWriter tryConstructRenderWriter(OutputStream stream)
org.codehaus.groovy.tools.shell back to summary

public final Class IO.Verbosity

extends Object
Class Inheritance

Verbosity for simple logging: QUIET, INFO, VERBOSE, DEBUG

Field Summary

Modifier and TypeField and Description
public static final IO.Verbosity
public static final IO.Verbosity
public final String
public static final IO.Verbosity
public static final IO.Verbosity

Constructor Summary

AccessConstructor and Description
private
Verbosity(final String name)

Method Summary

Modifier and TypeMethod and Description
public static IO.Verbosity
forName(final String name)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEBUGback to summary
public static final IO.Verbosity DEBUG
INFOback to summary
public static final IO.Verbosity INFO
nameback to summary
public final String name
QUIETback to summary
public static final IO.Verbosity QUIET
VERBOSEback to summary
public static final IO.Verbosity VERBOSE

Constructor Detail

Verbosityback to summary
private Verbosity(final String name)

Method Detail

forNameback to summary
public static IO.Verbosity forName(final String name)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.