public interface UserInteractionCallbackPlugin extends ExecContextPlugin
| Modifier and Type | Interface and Description |
|---|---|
static interface |
UserInteractionCallbackPlugin.BracketHandle
Represents a handle to an opened bracket or indentation in the output.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getInfo(String prompt)
Obtains information from the user.
|
String |
getInfoPassword(String prompt)
Obtains sensitive information from the user which should not be echoed back.
|
String |
getInfoWithDefault(String prompt,
String defaultValue)
Similar to
getInfo(java.lang.String), but if the user enters nothing, the provided
default value is returned. |
boolean |
isBatchMode() |
void |
provideInfo(String info)
Provides information information to the user at a new indentation level.
|
Writer |
provideInfoWithWriter(String info)
Provides information to the user in a way similar to
provideInfo(java.lang.String), but
returns a Writer so that the caller can append additional information. |
UserInteractionCallbackPlugin.BracketHandle |
startBracket(String info)
Provides information information to the user at a new indentation level.
|
UserInteractionCallbackPlugin.BracketHandle startBracket(String info)
info - Information.void provideInfo(String info)
info - Information.Writer provideInfoWithWriter(String info)
provideInfo(java.lang.String), but
returns a Writer so that the caller can append additional information.
The caller is responsible for closing the Writer when done so that the plugin is able to associate all of the additional information with the initial call to this method. Calling close in this case should not close some underlying stream in such a way that would render the system unstable. Specifically if the Writer delegates to System.out, it must not delegate the close call. This use of close is specific to the contract with this class and does not necessarily respect the general contract of Writer.close.
No call to other methods of this plugin are allowed as long as the Writer is not closed.
info - See similar parameter for provideInfo.String getInfo(String prompt)
Only allowed if not isBatchMode().
prompt - Prompt.String getInfoWithDefault(String prompt, String defaultValue)
getInfo(java.lang.String), but if the user enters nothing, the provided
default value is returned.prompt - Prompt.defaultValue - Default value.String getInfoPassword(String prompt)
prompt - Prompt.boolean isBatchMode()
getInfo(java.lang.String) and
getInfoWithDefault(java.lang.String, java.lang.String) are not allowed. Generally, caller should not
worry about this and let these method fail if in batch mode. But some
classes, such as DefaultCredetialStorePluginImpl, may need to know whether
batch mode is enabled.Copyright © 2015–2017 AZYVA INC.. All rights reserved.