@Component public class StandardParameterResolver extends Object implements ParameterResolver
ShellMethod.prefix())
Method arguments can consume several words of input at once (driven by
ShellOption.arity(), default 1). If several words are consumed, they will be
joined together as a comma separated value and passed to the ConversionService
(which will typically return a List or array).
Boolean parameters are by default expected to have an arity of 0, allowing invocations
in the form rm
--force --dir /foo: the presence of --force passes true as a parameter
value, while its absence passes false. Both the default arity of 0 and the
default value of false can be overridden via ShellOption if
needed.
| Constructor and Description |
|---|
StandardParameterResolver(org.springframework.core.convert.ConversionService conversionService) |
| Modifier and Type | Method and Description |
|---|---|
List<CompletionProposal> |
complete(org.springframework.core.MethodParameter methodParameter,
CompletionContext context) |
Stream<ParameterDescription> |
describe(org.springframework.core.MethodParameter parameter) |
ValueResult |
resolve(org.springframework.core.MethodParameter methodParameter,
List<String> wordsBuffer) |
void |
setValidatorFactory(javax.validation.ValidatorFactory validatorFactory) |
void |
setValueProviders(Collection<ValueProvider> valueProviders) |
boolean |
supports(org.springframework.core.MethodParameter parameter) |
@Autowired public StandardParameterResolver(org.springframework.core.convert.ConversionService conversionService)
@Autowired(required=false) public void setValueProviders(Collection<ValueProvider> valueProviders)
@Autowired(required=false) public void setValidatorFactory(javax.validation.ValidatorFactory validatorFactory)
public boolean supports(org.springframework.core.MethodParameter parameter)
supports in interface ParameterResolverpublic ValueResult resolve(org.springframework.core.MethodParameter methodParameter, List<String> wordsBuffer)
resolve in interface ParameterResolverpublic Stream<ParameterDescription> describe(org.springframework.core.MethodParameter parameter)
describe in interface ParameterResolverpublic List<CompletionProposal> complete(org.springframework.core.MethodParameter methodParameter, CompletionContext context)
complete in interface ParameterResolverCopyright © 2017 Pivotal Software, Inc.. All rights reserved.