Package org.springframework.shell
Class Utils
java.lang.Object
org.springframework.shell.Utils
Some text utilities.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.core.MethodParameter
createMethodParameter
(Executable executable, int i) Return a properly initialized MethodParameter for the given executable and index.static org.springframework.core.MethodParameter
createMethodParameter
(Parameter parameter) Convert from JDKParameter
to SpringMethodParameter
.static Stream<org.springframework.core.MethodParameter>
createMethodParameters
(Executable executable) Return MethodParameters for each parameter of the given method/constructor.static jakarta.validation.Validator
Gets a default shared validator.static jakarta.validation.ValidatorFactory
Gets a default shared validation factory.static Map<String,
CommandRegistration> removeHiddenCommands
(Map<String, CommandRegistration> registrations) Takes a map of command registrations and removes hidden commands from it.sanitizeInput
(List<String> words) Sanitize the buffer input given the customizations applied to the JLine parser (e.g. support for line continuations, etc.)Split array into list of lists by predicatestatic String
unCamelify
(CharSequence original) Turn CamelCaseText into gnu-style-lowercase.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
unCamelify
Turn CamelCaseText into gnu-style-lowercase. -
createMethodParameter
Convert from JDKParameter
to SpringMethodParameter
. -
createMethodParameter
public static org.springframework.core.MethodParameter createMethodParameter(Executable executable, int i) Return a properly initialized MethodParameter for the given executable and index. -
createMethodParameters
public static Stream<org.springframework.core.MethodParameter> createMethodParameters(Executable executable) Return MethodParameters for each parameter of the given method/constructor. -
sanitizeInput
Sanitize the buffer input given the customizations applied to the JLine parser (e.g. support for line continuations, etc.) -
defaultValidatorFactory
public static jakarta.validation.ValidatorFactory defaultValidatorFactory()Gets a default shared validation factory.- Returns:
- default validation factory
-
defaultValidator
public static jakarta.validation.Validator defaultValidator()Gets a default shared validator.- Returns:
- default validator
-
split
Split array into list of lists by predicate- Parameters:
array
- the arraypredicate
- the predicate- Returns:
- the list of lists
-
removeHiddenCommands
public static Map<String,CommandRegistration> removeHiddenCommands(Map<String, CommandRegistration> registrations) Takes a map of command registrations and removes hidden commands from it.- Parameters:
registrations
- a command registrations- Returns:
- same map with removed hidden commands
-