Top Description Inners Fields Constructors Methods
liquibase.ui

public Class ConsoleUIService

extends AbstractExtensibleObject
implements UIService
Class Inheritance
All Implemented Interfaces
liquibase.ui.UIService, liquibase.plugin.Plugin, liquibase.ExtensibleObject, java.lang.Cloneable
Imports
liquibase.AbstractExtensibleObject, .GlobalConfiguration, .Scope, liquibase.configuration.ConfiguredValue, liquibase.logging.Logger, liquibase.util.StringUtil, java.io.*

UIService implementation that sends messages to stdout and stderr.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ConsoleUIService.ConsoleWrapper

Wrapper around Console to allow replacements as needed.

Field Summary

Modifier and TypeField and Description
private boolean
private ConsoleUIService.ConsoleWrapper
private PrintStream
public static final String
public static final String
public static final String
private boolean
private PrintStream
public static final String

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
public boolean
getAllowPrompt()

Implements liquibase.ui.UIService.getAllowPrompt.

Return current setting of allow prompt flag

protected ConsoleUIService.ConsoleWrapper
getConsole()

Creates the ConsoleWrapper to use.

public PrintStream
public boolean
public PrintStream
public int
getPriority()

Implements liquibase.ui.UIService.getPriority.

Returns liquibase.plugin.Plugin#PRIORITY_NOT_APPLICABLE because it must be manually configured as needed

public <T> T
prompt(String prompt, T valueIfNoEntry, InputHandler<T> inputHandler, Class<T> type)

Implements liquibase.ui.UIService.prompt.

Prompt the user with the message and wait for a response.

public void
sendErrorMessage(String message)

Implements liquibase.ui.UIService.sendErrorMessage.

Send an "error" message to the user.

public void
sendErrorMessage(String message, Throwable exception)

Implements liquibase.ui.UIService.sendErrorMessage.

Send an "error" message to the user along with a stacktrace.

public void
sendMessage(String message)

Implements liquibase.ui.UIService.sendMessage.

Send a "normal" message to the user.

public void
setAllowPrompt(boolean
New flag value
allowPrompt
)

Implements liquibase.ui.UIService.setAllowPrompt.

Method to set flag indicating whether prompting is allowed

public void
public void
setOutputStackTraces(boolean outputStackTraces)

Set to true to output stacktraces.

public void
Inherited from liquibase.AbstractExtensibleObject:
clonedescribeequalsgetgetgetgetAttributesgetFieldValuegetObjectMetaDatagetValuePathhashashCodesettoString

Field Detail

allowPromptback to summary
private boolean allowPrompt
consoleback to summary
private ConsoleUIService.ConsoleWrapper console
errorStreamback to summary
private PrintStream errorStream
MINGW64back to summary
public static final String MINGW64
MINTTYback to summary
public static final String MINTTY
MSYSTEMback to summary
public static final String MSYSTEM
outputStackTracesback to summary
private boolean outputStackTraces
outputStreamback to summary
private PrintStream outputStream
TERM_PROGRAMback to summary
public static final String TERM_PROGRAM

Constructor Detail

ConsoleUIServiceback to summary
public ConsoleUIService()
ConsoleUIServiceback to summary
protected ConsoleUIService(ConsoleUIService.ConsoleWrapper console)

Method Detail

getAllowPromptback to summary
public boolean getAllowPrompt()

Implements liquibase.ui.UIService.getAllowPrompt.

Doc from liquibase.ui.UIService.getAllowPrompt.

Return current setting of allow prompt flag

Returns:boolean

boolean

Annotations
@Override
getConsoleback to summary
protected ConsoleUIService.ConsoleWrapper getConsole()

Creates the ConsoleWrapper to use.

getErrorStreamback to summary
public PrintStream getErrorStream()
Annotations
@SuppressWarnings:WeakerAccess
getOutputStackTracesback to summary
public boolean getOutputStackTraces()
Annotations
@SuppressWarnings:WeakerAccess
getOutputStreamback to summary
public PrintStream getOutputStream()
Annotations
@SuppressWarnings:WeakerAccess
getPriorityback to summary
public int getPriority()

Implements liquibase.ui.UIService.getPriority.

Returns liquibase.plugin.Plugin#PRIORITY_NOT_APPLICABLE because it must be manually configured as needed

Annotations
@Override
promptback to summary
public <T> T prompt(String prompt, T valueIfNoEntry, InputHandler<T> inputHandler, Class<T> type)

Implements liquibase.ui.UIService.prompt.

Doc from liquibase.ui.UIService.prompt.

Prompt the user with the message and wait for a response.
If this UIService implementation does not support user prompts, return the default value.
If inputHandler is null, DefaultInputHandler will be used.
If inputHandler throws an IllegalArgumentException, the user will be given the chance to re-enter the value.
If the inputHandler returns true for InputHandler#shouldAllowEmptyInput() and the user enters an empty value when prompted, or hits "enter", the valueIfNoEntry will be returned. If the inputHandler returns false for InputHandler#shouldAllowEmptyInput(), the user will be reprompted until they enter a non-empty value, which will then be returned.

Annotations
@Override
sendErrorMessageback to summary
public void sendErrorMessage(String message)

Implements liquibase.ui.UIService.sendErrorMessage.

Doc from liquibase.ui.UIService.sendErrorMessage.

Send an "error" message to the user.

Annotations
@Override
sendErrorMessageback to summary
public void sendErrorMessage(String message, Throwable exception)

Implements liquibase.ui.UIService.sendErrorMessage.

Doc from liquibase.ui.UIService.sendErrorMessage.

Send an "error" message to the user along with a stacktrace.

Annotations
@Override
sendMessageback to summary
public void sendMessage(String message)

Implements liquibase.ui.UIService.sendMessage.

Doc from liquibase.ui.UIService.sendMessage.

Send a "normal" message to the user.

Annotations
@Override
setAllowPromptback to summary
public void setAllowPrompt(boolean allowPrompt) throws IllegalArgumentException

Implements liquibase.ui.UIService.setAllowPrompt.

Doc from liquibase.ui.UIService.setAllowPrompt.

Method to set flag indicating whether prompting is allowed

Parameters
allowPrompt:boolean

New flag value

Annotations
@Override
Exceptions
IllegalArgumentException:
If parameter is not allowed
setErrorStreamback to summary
public void setErrorStream(PrintStream errorStream)
Annotations
@SuppressWarnings:unused
setOutputStackTracesback to summary
public void setOutputStackTraces(boolean outputStackTraces)

Set to true to output stacktraces. Defaults to not outputing them.

Annotations
@SuppressWarnings:unused
setOutputStreamback to summary
public void setOutputStream(PrintStream outputStream)
Annotations
@SuppressWarnings:unused
liquibase.ui back to summary

public Class ConsoleUIService.ConsoleWrapper

extends Object
Class Inheritance
Known Direct Subclasses
liquibase.ui.MockConsoleWrapper

Wrapper around Console to allow replacements as needed. If the passed Console is null, supportsInput() will return false, and readLine() will return null.

Field Summary

Modifier and TypeField and Description
private final Console
private final boolean

Constructor Summary

AccessConstructor and Description
public
ConsoleWrapper(Console
the console to use
console
)

This constructor is used for extensions that provide UIService implementations

public
ConsoleWrapper(Console console, boolean useStdInParam)

Method Summary

Modifier and TypeMethod and Description
public String
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

consoleback to summary
private final Console console
useStdinback to summary
private final boolean useStdin

Constructor Detail

ConsoleWrapperback to summary
public ConsoleWrapper(Console console)

This constructor is used for extensions that provide UIService implementations

Parameters
console:Console

the console to use

ConsoleWrapperback to summary
public ConsoleWrapper(Console console, boolean useStdInParam)

Method Detail

readLineback to summary
public String readLine()
supportsInputback to summary
public boolean supportsInput()