Class Utils
java.lang.Object
org.springframework.shell.core.utils.Utils
Some text utilities.
- Author:
- Eric Bottard, Mahmoud Ben Hassine
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.validation.ValidatorGets a default shared validator.static jakarta.validation.ValidatorFactoryGets a default shared validation factory.static StringformatAvailableCommands(CommandRegistry commandRegistry) Get a formatted string of available non-hidden commands from the command registry.static ObjectgetDefaultValueForPrimitiveType(Class<?> type) static StringsplitCamelCase(String className) Split a CamelCase class name into separate words.static StringunCamelify(CharSequence original) Turn CamelCaseText into gnu-style-lowercase.
-
Field Details
-
QUIT_COMMAND
-
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
splitCamelCase
Split a CamelCase class name into separate words. Used to derive command group names. For example, "MyCommands" becomes "My Commands".- Parameters:
className- the simple class name- Returns:
- the split string
-
unCamelify
Turn CamelCaseText into gnu-style-lowercase. -
formatAvailableCommands
Get a formatted string of available non-hidden commands from the command registry.- Parameters:
commandRegistry- the command registry- Returns:
- a string of available commands with their descriptions
- Since:
- 4.0.0
-
getDefaultValueForPrimitiveType
-
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
-