Package liquibase.ui
Class ConsoleUIService
java.lang.Object
liquibase.AbstractExtensibleObject
liquibase.ui.ConsoleUIService
- All Implemented Interfaces:
- Cloneable,- ExtensibleObject,- Plugin,- UIService
- Direct Known Subclasses:
- MavenUi
UIService implementation that sends messages to stdout and stderr.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classWrapper aroundConsoleto allow replacements as needed.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface liquibase.plugin.PluginPRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotected
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturn current setting of allow prompt flagprotected ConsoleUIService.ConsoleWrapperCreates theConsoleUIService.ConsoleWrapperto use.booleanintReturnsPlugin.PRIORITY_NOT_APPLICABLEbecause it must be manually configured as needed<T> Tprompt(String prompt, T valueIfNoEntry, InputHandler<T> inputHandler, Class<T> type) 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,DefaultInputHandlerwill be used.
 If inputHandler throws anIllegalArgumentException, the user will be given the chance to re-enter the value.
 If the inputHandler returns true forInputHandler.shouldAllowEmptyInput()and the user enters an empty value when prompted, or hits "enter", the valueIfNoEntry will be returned.voidsendErrorMessage(String message) Send an "error" message to the user.voidsendErrorMessage(String message, Throwable exception) Send an "error" message to the user along with a stacktrace.voidsendMessage(String message) Send a "normal" message to the user.voidsetAllowPrompt(boolean allowPrompt) Method to set flag indicating whether prompting is allowedvoidsetErrorStream(PrintStream errorStream) voidsetOutputStackTraces(boolean outputStackTraces) Set to true to output stacktraces.voidsetOutputStream(PrintStream outputStream) Methods inherited from class liquibase.AbstractExtensibleObjectclone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set, toStringMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.ExtensibleObjectclone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
- 
Field Details- 
TERM_PROGRAM- See Also:
 
- 
MINTTY- See Also:
 
- 
MSYSTEM- See Also:
 
- 
MINGW64- See Also:
 
 
- 
- 
Constructor Details- 
ConsoleUIServicepublic ConsoleUIService()
- 
ConsoleUIService
 
- 
- 
Method Details- 
getPrioritypublic int getPriority()ReturnsPlugin.PRIORITY_NOT_APPLICABLEbecause it must be manually configured as needed- Specified by:
- getPriorityin interface- UIService
 
- 
sendMessageDescription copied from interface:UIServiceSend a "normal" message to the user.- Specified by:
- sendMessagein interface- UIService
 
- 
sendErrorMessageDescription copied from interface:UIServiceSend an "error" message to the user.- Specified by:
- sendErrorMessagein interface- UIService
 
- 
sendErrorMessageDescription copied from interface:UIServiceSend an "error" message to the user along with a stacktrace.- Specified by:
- sendErrorMessagein interface- UIService
 
- 
setAllowPromptDescription copied from interface:UIServiceMethod to set flag indicating whether prompting is allowed- Specified by:
- setAllowPromptin interface- UIService
- Parameters:
- allowPrompt- New flag value
- Throws:
- IllegalArgumentException- If parameter is not allowed
 
- 
getAllowPromptpublic boolean getAllowPrompt()Description copied from interface:UIServiceReturn current setting of allow prompt flag- Specified by:
- getAllowPromptin interface- UIService
- Returns:
- boolean
 
- 
promptDescription copied from interface:UIServicePrompt 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,DefaultInputHandlerwill be used.
 If inputHandler throws anIllegalArgumentException, the user will be given the chance to re-enter the value.
 If the inputHandler returns true forInputHandler.shouldAllowEmptyInput()and the user enters an empty value when prompted, or hits "enter", the valueIfNoEntry will be returned. If the inputHandler returns false forInputHandler.shouldAllowEmptyInput(), the user will be reprompted until they enter a non-empty value, which will then be returned.
- 
getConsoleCreates theConsoleUIService.ConsoleWrapperto use.
- 
getOutputStream
- 
setOutputStream
- 
getErrorStream
- 
setErrorStream
- 
getOutputStackTracespublic boolean getOutputStackTraces()
- 
setOutputStackTracespublic void setOutputStackTraces(boolean outputStackTraces) Set to true to output stacktraces. Defaults to not outputing them.
 
-