Class BaseStringInput
java.lang.Object
org.springframework.shell.tui.component.flow.BaseInput<StringInputSpec>
org.springframework.shell.tui.component.flow.BaseStringInput
- All Implemented Interfaces:
org.springframework.core.Ordered,BaseInputSpec<StringInputSpec>,StringInputSpec
- Direct Known Subclasses:
DefaultStringInputSpec
Base impl for
StringInputSpec.- Author:
- Janne Valkealahti
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()Build and return parent builder.defaultValue(String defaultValue) Sets a default value.getName()getNext()Function<StringInput.StringInputContext,List<org.jline.utils.AttributedString>> getThis()Usual this trick to get typed child.booleanmaskCharacter(Character maskCharacter) Sets a mask character.Sets a name.Define a function which may return id of a next component to go.Adds a post-run context handler.preHandler(Consumer<StringInput.StringInputContext> handler) Adds a pre-run context handler.renderer(Function<StringInput.StringInputContext, List<org.jline.utils.AttributedString>> renderer) Sets a renderer function.resultMode(ResultMode resultMode) Sets a result mode.resultValue(String resultValue) Sets a result value.storeResult(boolean store) Automatically stores result from aStringInput.StringInputContextintoComponentContextwith key given to builder.Sets a default renderer template location.Methods inherited from class org.springframework.shell.tui.component.flow.BaseInput
getBuilder, getId, getOrder, order, setOrderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.shell.tui.component.flow.BaseInputSpec
order
-
Constructor Details
-
BaseStringInput
-
-
Method Details
-
name
Description copied from interface:StringInputSpecSets a name.- Specified by:
namein interfaceStringInputSpec- Parameters:
name- the name- Returns:
- a builder
-
resultValue
Description copied from interface:StringInputSpecSets a result value.- Specified by:
resultValuein interfaceStringInputSpec- Parameters:
resultValue- the result value- Returns:
- a builder
-
resultMode
Description copied from interface:StringInputSpecSets a result mode.- Specified by:
resultModein interfaceStringInputSpec- Parameters:
resultMode- the result mode- Returns:
- a builder
-
defaultValue
Description copied from interface:StringInputSpecSets a default value.- Specified by:
defaultValuein interfaceStringInputSpec- Parameters:
defaultValue- the defult value- Returns:
- a builder
-
maskCharacter
Description copied from interface:StringInputSpecSets a mask character.- Specified by:
maskCharacterin interfaceStringInputSpec- Parameters:
maskCharacter- the mask character- Returns:
- a builder
-
renderer
public StringInputSpec renderer(Function<StringInput.StringInputContext, List<org.jline.utils.AttributedString>> renderer) Description copied from interface:StringInputSpecSets a renderer function.- Specified by:
rendererin interfaceStringInputSpec- Parameters:
renderer- the renderer- Returns:
- a builder
-
template
Description copied from interface:StringInputSpecSets a default renderer template location.- Specified by:
templatein interfaceStringInputSpec- Parameters:
location- the template location- Returns:
- a builder
-
preHandler
Description copied from interface:StringInputSpecAdds a pre-run context handler.- Specified by:
preHandlerin interfaceStringInputSpec- Parameters:
handler- the context handler- Returns:
- a builder
-
postHandler
Description copied from interface:StringInputSpecAdds a post-run context handler.- Specified by:
postHandlerin interfaceStringInputSpec- Parameters:
handler- the context handler- Returns:
- a builder
-
storeResult
Description copied from interface:StringInputSpecAutomatically stores result from aStringInput.StringInputContextintoComponentContextwith key given to builder. Defaults totrue.- Specified by:
storeResultin interfaceStringInputSpec- Parameters:
store- the flag if storing result- Returns:
- a builder
-
next
Description copied from interface:StringInputSpecDefine a function which may return id of a next component to go. Returning anullor non existent id indicates that flow should stop.- Specified by:
nextin interfaceStringInputSpec- Parameters:
next- next component function- Returns:
- a builder
-
and
Description copied from interface:StringInputSpecBuild and return parent builder.- Specified by:
andin interfaceStringInputSpec- Returns:
- the parent builder
-
getThis
Description copied from interface:BaseInputSpecUsual this trick to get typed child.- Specified by:
getThisin interfaceBaseInputSpec<StringInputSpec>- Returns:
- a builder
-
getName
-
getResultValue
-
getResultMode
-
getDefaultValue
-
getMaskCharacter
-
getRenderer
public Function<StringInput.StringInputContext,List<org.jline.utils.AttributedString>> getRenderer() -
getTemplateLocation
-
getPreHandlers
-
getPostHandlers
-
isStoreResult
public boolean isStoreResult() -
getNext
-