Class BaseStringInput
java.lang.Object
org.springframework.shell.component.flow.BaseInput<StringInputSpec>
org.springframework.shell.component.flow.BaseStringInput
- All Implemented Interfaces:
org.springframework.core.Ordered
,BaseInputSpec<StringInputSpec>
,StringInputSpec
- Direct Known Subclasses:
DefaultStringInputSpec
Base impl for
StringInputSpec
.-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
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.boolean
maskCharacter
(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.StringInputContext
intoComponentContext
with key given to builder.Sets a default renderer template location.Methods inherited from class org.springframework.shell.component.flow.BaseInput
getBuilder, getId, getOrder, order, setOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.shell.component.flow.BaseInputSpec
order
-
Constructor Details
-
BaseStringInput
-
-
Method Details
-
name
Description copied from interface:StringInputSpec
Sets a name.- Specified by:
name
in interfaceStringInputSpec
- Parameters:
name
- the name- Returns:
- a builder
-
resultValue
Description copied from interface:StringInputSpec
Sets a result value.- Specified by:
resultValue
in interfaceStringInputSpec
- Parameters:
resultValue
- the result value- Returns:
- a builder
-
resultMode
Description copied from interface:StringInputSpec
Sets a result mode.- Specified by:
resultMode
in interfaceStringInputSpec
- Parameters:
resultMode
- the result mode- Returns:
- a builder
-
defaultValue
Description copied from interface:StringInputSpec
Sets a default value.- Specified by:
defaultValue
in interfaceStringInputSpec
- Parameters:
defaultValue
- the defult value- Returns:
- a builder
-
maskCharacter
Description copied from interface:StringInputSpec
Sets a mask character.- Specified by:
maskCharacter
in 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:StringInputSpec
Sets a renderer function.- Specified by:
renderer
in interfaceStringInputSpec
- Parameters:
renderer
- the renderer- Returns:
- a builder
-
template
Description copied from interface:StringInputSpec
Sets a default renderer template location.- Specified by:
template
in interfaceStringInputSpec
- Parameters:
location
- the template location- Returns:
- a builder
-
preHandler
Description copied from interface:StringInputSpec
Adds a pre-run context handler.- Specified by:
preHandler
in interfaceStringInputSpec
- Parameters:
handler
- the context handler- Returns:
- a builder
-
postHandler
Description copied from interface:StringInputSpec
Adds a post-run context handler.- Specified by:
postHandler
in interfaceStringInputSpec
- Parameters:
handler
- the context handler- Returns:
- a builder
-
storeResult
Description copied from interface:StringInputSpec
Automatically stores result from aStringInput.StringInputContext
intoComponentContext
with key given to builder. Defaults totrue
.- Specified by:
storeResult
in interfaceStringInputSpec
- Parameters:
store
- the flag if storing result- Returns:
- a builder
-
next
Description copied from interface:StringInputSpec
Define a function which may return id of a next component to go. Returning anull
or non existent id indicates that flow should stop.- Specified by:
next
in interfaceStringInputSpec
- Parameters:
next
- next component function- Returns:
- a builder
-
and
Description copied from interface:StringInputSpec
Build and return parent builder.- Specified by:
and
in interfaceStringInputSpec
- Returns:
- the parent builder
-
getThis
Description copied from interface:BaseInputSpec
Usual this trick to get typed child.- Specified by:
getThis
in 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
-