[Java] Class IO
- org.codehaus.groovy.tools.shell.IO
- All Implemented Interfaces and Traits:
- Closeable
public class IO extends Object
Container for input/output handles.
Nested Class Summary
Modifiers | Name | Description |
---|---|---|
static class | IO.Verbosity | Verbosity for simple logging: QUIET, INFO, VERBOSE, DEBUG |
Field Summary
Modifiers | Name | Description |
---|---|---|
boolean | ansiSupported | Whether ansi support is available |
PrintWriter | err | Preferred error output writer. |
OutputStream | errorStream | Raw error output stream. |
Reader | in | Preferred input reader. |
InputStream | inputStream | Raw input stream. |
PrintWriter | out | Preferred output writer. |
OutputStream | outputStream | Raw output stream. |
Properties Summary
Type | Name and description |
---|---|
IO.Verbosity |
verbosity |
Constructor Summary
Constructor and description |
---|
IO
(InputStream inputStream, OutputStream outputStream, OutputStream errorStream) Construct a new IO container. |
IO
() Construct a new IO container using system streams. |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
void |
close() Close all streams. | |
void |
flush() Flush both output streams. | |
IO.Verbosity |
getVerbosity() Returns the verbosity level. | |
boolean |
isDebug() Check if the verbosity level is set to Verbosity#DEBUG#DEBUG. | |
boolean |
isInfo() Check if the verbosity level is set to Verbosity#INFO#INFO. | |
boolean |
isQuiet() Check if the verbosity level is set to Verbosity#QUIET#QUIET. | |
boolean |
isVerbose() Check if the verbosity level is set to Verbosity#VERBOSE#VERBOSE. | |
void |
setVerbosity(IO.Verbosity verbosity) Set the verbosity level. | |
protected PrintWriter |
tryConstructRenderWriter(OutputStream stream) |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail
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.
Property Detail
IO.Verbosity verbosity
Constructor Detail
public IO(InputStream inputStream, OutputStream outputStream, OutputStream errorStream)
Construct a new IO container.
public IO()
Construct a new IO container using system streams.
Method Detail
public void 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#DEBUG.
For general usage, when debug output is required, it is better to use the logging facility instead.
public boolean isInfo()
Check if the verbosity level is set to Verbosity#INFO#INFO.
public boolean isQuiet()
Check if the verbosity level is set to Verbosity#QUIET#QUIET.
public boolean isVerbose()
Check if the verbosity level is set to Verbosity#VERBOSE#VERBOSE.
public void setVerbosity(IO.Verbosity verbosity)
Set the verbosity level.
protected PrintWriter tryConstructRenderWriter(OutputStream stream)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.5.14/html/gapi/org/codehaus/groovy/tools/shell/IO.html