@Beta public class CompositeUIService extends AbstractExtensibleObject implements UIService
Modifier and Type | Field and Description |
---|---|
UIService |
inputService |
List<UIService> |
outputServices |
PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
Constructor and Description |
---|
CompositeUIService(UIService inputService,
Collection<UIService> outputServices) |
Modifier and Type | Method and Description |
---|---|
boolean |
getAllowPrompt()
Return current setting of allow prompt flag
|
List<UIService> |
getOutputServices() |
int |
getPriority() |
<T> T |
prompt(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, 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. |
void |
sendErrorMessage(String message)
Send an "error" message to the user.
|
void |
sendErrorMessage(String message,
Throwable exception)
Send an "error" message to the user along with a stacktrace.
|
void |
sendMessage(String message)
Send a "normal" message to the user.
|
void |
setAllowPrompt(boolean allowPrompt)
Method to set flag indicating whether prompting is allowed
|
clone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
public final UIService inputService
public CompositeUIService(UIService inputService, Collection<UIService> outputServices)
public int getPriority()
getPriority
in interface UIService
public void sendMessage(String message)
UIService
sendMessage
in interface UIService
public void sendErrorMessage(String message)
UIService
sendErrorMessage
in interface UIService
public void sendErrorMessage(String message, Throwable exception)
UIService
sendErrorMessage
in interface UIService
public <T> T prompt(String prompt, T valueIfNoEntry, InputHandler<T> inputHandler, Class<T> type)
UIService
DefaultInputHandler
will be used.IllegalArgumentException
, the user will be given the chance to re-enter the value.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.public void setAllowPrompt(boolean allowPrompt) throws IllegalArgumentException
UIService
setAllowPrompt
in interface UIService
allowPrompt
- New flag valueIllegalArgumentException
- If parameter is not allowedpublic boolean getAllowPrompt()
UIService
getAllowPrompt
in interface UIService
Copyright © 2023 Liquibase.org. All rights reserved.