ConfigurableSensibleUi.Builder
public static final class DefaultConfigurableSensibleUi.Builder extends Object implements ConfigurableSensibleUi.Builder
DefaultConfigurableSensibleUi
instances.Constructor | Description |
---|---|
Builder() |
Constructs an instance.
|
Builder(DefaultConfigurableSensibleUi.Builder b) |
Constructs an instance with the same values as the specified builder.
|
Modifier and Type | Method | Description |
---|---|---|
DefaultConfigurableSensibleUi.Builder |
autoFlushStderr(boolean autoFlush) |
Sets whether the standard error stream should be automatically flushed.
|
DefaultConfigurableSensibleUi.Builder |
autoFlushStdout(boolean autoFlush) |
Sets whether the standard output stream should be automatically flushed.
|
DefaultConfigurableSensibleUi |
build() |
Creates a new UI from this builder.
|
DefaultConfigurableSensibleUi.Builder |
console(ProgramConsole console) |
Sets the console used for prompting the user.
|
DefaultConfigurableSensibleUi.Builder |
debug(boolean debug) |
Sets the
debug level flag. |
DefaultConfigurableSensibleUi.Builder |
debugPrefix(String debugPrefix) |
Sets the prefix for debug messages.
|
DefaultConfigurableSensibleUi.Builder |
debugTo(StandardIo debugTo) |
Selects which of this builder's output streams debug messages should be
written to.
|
DefaultConfigurableSensibleUi.Builder |
errorPrefix(String errorPrefix) |
Sets the prefix for error messages.
|
DefaultConfigurableSensibleUi.Builder |
locale(Locale locale) |
Sets the locale to use for locale-sensitive operations.
|
DefaultConfigurableSensibleUi.Builder |
notePrefix(String notePrefix) |
Sets the prefix for note messages.
|
DefaultConfigurableSensibleUi.Builder |
noteTo(StandardIo noteTo) |
Selects which of this builder's output streams note messages should be
written to.
|
DefaultConfigurableSensibleUi.Builder |
printStackTrace(boolean printStackTrace) |
Sets whether exception stack traces should be printed.
|
DefaultConfigurableSensibleUi.Builder |
programName(String programName) |
Sets the name of the program.
|
DefaultConfigurableSensibleUi.Builder |
quiet(boolean quiet) |
Sets the
quiet level flag. |
DefaultConfigurableSensibleUi.Builder |
statusPrefix(String statusPrefix) |
Sets the prefix for status messages.
|
DefaultConfigurableSensibleUi.Builder |
statusTo(StandardIo statusTo) |
Selects which of this builder's output streams status messages should be
written to.
|
DefaultConfigurableSensibleUi.Builder |
stderr(Appendable stderr) |
Sets the standard error stream.
|
DefaultConfigurableSensibleUi.Builder |
stdout(Appendable stdout) |
Sets the standard output stream.
|
DefaultConfigurableSensibleUi.Builder |
useLocalizedExceptionMessage(boolean useLocalizedExceptionMessage) |
Sets whether to use localized or non-localized exception messages when
printing messages from exceptions.
|
DefaultConfigurableSensibleUi.Builder |
verbose(boolean verbose) |
Sets the
verbose level flag. |
DefaultConfigurableSensibleUi.Builder |
warnPrefix(String warnPrefix) |
Sets the prefix for warn messages.
|
public Builder()
public Builder(DefaultConfigurableSensibleUi.Builder b)
b
- the builder whose values are to be placed in this builderpublic DefaultConfigurableSensibleUi.Builder programName(String programName)
The default is null
.
programName
in interface ConfigurableSensibleUi.Builder
programName
- the name of the program; may be null
; must
not be an empty stringpublic DefaultConfigurableSensibleUi.Builder console(ProgramConsole console)
The default is a ProgramConsole
wrapping the system console
returned by System.console()
. If System.console()
returns null
, then the default is null
.
console
in interface ConfigurableSensibleUi.Builder
console
- the console; may be null
public DefaultConfigurableSensibleUi.Builder stdout(Appendable stdout)
The default is a buffered Writer
on the system standard output
stream using the system character
set.
stdout
in interface ConfigurableSensibleUi.Builder
stdout
- the standard output streampublic DefaultConfigurableSensibleUi.Builder stderr(Appendable stderr)
The default is an unbuffered Writer
on the system standard error
stream using the system character
set.
stderr
in interface ConfigurableSensibleUi.Builder
stderr
- the standard error streampublic DefaultConfigurableSensibleUi.Builder autoFlushStdout(boolean autoFlush)
if true
, methods of the built UI that write to the standard
output stream will flush the standard output stream after writing to it.
The default is true
if the console of the built UI is present;
false
otherwise.
autoFlushStdout
in interface ConfigurableSensibleUi.Builder
autoFlush
- whether to automatically flush the standard output
streampublic DefaultConfigurableSensibleUi.Builder autoFlushStderr(boolean autoFlush)
if true
, methods of the built UI that write to the standard
error stream will flush the standard error stream after writing to it.
The default is false
.
autoFlushStderr
in interface ConfigurableSensibleUi.Builder
autoFlush
- whether to automatically flush the standard error
streampublic DefaultConfigurableSensibleUi.Builder locale(Locale locale)
The default is the system locale.
locale
in interface ConfigurableSensibleUi.Builder
locale
- the localepublic DefaultConfigurableSensibleUi.Builder quiet(boolean quiet)
quiet
level flag.
If true
, status messages will not be printed.
If the debug
flag is true
, the quiet
flag will
become false
and the verbose
flag will become
true
. If both the quiet
flag and the verbose
flag are true
, they will cancel out and become false
.
The default is false
.
quiet
in interface ConfigurableSensibleUi.Builder
quiet
- the quiet
level flagpublic DefaultConfigurableSensibleUi.Builder verbose(boolean verbose)
verbose
level flag.
If true
, note messages will be printed.
If the debug
flag is true
, the quiet
flag will
become false
and the verbose
flag will become
true
. If both the quiet
flag and the verbose
flag are true
, they will cancel out and become false
.
The default is false
.
verbose
in interface ConfigurableSensibleUi.Builder
verbose
- the verbose
level flagpublic DefaultConfigurableSensibleUi.Builder debug(boolean debug)
debug
level flag.
If true
, debug messages will be printed.
If the debug
flag is true
, the quiet
flag will
become false
and the verbose
flag will become
true
. If both the quiet
flag and the verbose
flag are true
, they will cancel out and become false
.
The default is false
.
debug
in interface ConfigurableSensibleUi.Builder
debug
- the debug
level flagpublic DefaultConfigurableSensibleUi.Builder printStackTrace(boolean printStackTrace)
If stack traces are printed, they will be printed using the system locale, not this builder's locale.
The default is true
.
printStackTrace
in interface ConfigurableSensibleUi.Builder
printStackTrace
- whether to print stack tracespublic DefaultConfigurableSensibleUi.Builder useLocalizedExceptionMessage(boolean useLocalizedExceptionMessage)
The default is false
.
useLocalizedExceptionMessage
in interface ConfigurableSensibleUi.Builder
useLocalizedExceptionMessage
- whether to use localized or
non-localized exception messagespublic DefaultConfigurableSensibleUi.Builder statusTo(StandardIo statusTo)
The default is StandardIo.OUTPUT
.
statusTo
in interface ConfigurableSensibleUi.Builder
statusTo
- which output stream status messages should be written
to; must be StandardIo.OUTPUT
or
StandardIo.ERROR
public DefaultConfigurableSensibleUi.Builder noteTo(StandardIo noteTo)
The default is StandardIo.OUTPUT
.
noteTo
in interface ConfigurableSensibleUi.Builder
noteTo
- which output stream note messages should be written to;
must be StandardIo.OUTPUT
or StandardIo.ERROR
public DefaultConfigurableSensibleUi.Builder debugTo(StandardIo debugTo)
The default is StandardIo.OUTPUT
.
debugTo
in interface ConfigurableSensibleUi.Builder
debugTo
- which output stream debug messages should be written to;
must be StandardIo.OUTPUT
or StandardIo.ERROR
public DefaultConfigurableSensibleUi.Builder statusPrefix(String statusPrefix)
All status messages will be prefixed with the specified prefix.
The default is the empty string.
statusPrefix
in interface ConfigurableSensibleUi.Builder
statusPrefix
- the prefix for status messagespublic DefaultConfigurableSensibleUi.Builder notePrefix(String notePrefix)
All note messages will be prefixed with the specified prefix.
The default is the empty string.
notePrefix
in interface ConfigurableSensibleUi.Builder
notePrefix
- the prefix for note messagespublic DefaultConfigurableSensibleUi.Builder debugPrefix(String debugPrefix)
All debug messages will be prefixed with the specified prefix.
The default is the empty string.
debugPrefix
in interface ConfigurableSensibleUi.Builder
debugPrefix
- the prefix for debug messagespublic DefaultConfigurableSensibleUi.Builder warnPrefix(String warnPrefix)
All warn messages will be prefixed with the specified prefix.
The default is the program name followed by a colon character and a space. If the program name is not set, the default is the empty string.
warnPrefix
in interface ConfigurableSensibleUi.Builder
warnPrefix
- the prefix for warn messagespublic DefaultConfigurableSensibleUi.Builder errorPrefix(String errorPrefix)
All error messages will be prefixed with the specified prefix.
The default is the program name followed by a colon character and a space. If the program name is not set, the default is the empty string.
errorPrefix
in interface ConfigurableSensibleUi.Builder
errorPrefix
- the prefix for error messagespublic DefaultConfigurableSensibleUi build()
ConfigurableSensibleUi.Builder
build
in interface ConfigurableSensibleUi.Builder