org.springframework.shell.converters
Class DateConverter
java.lang.Object
org.springframework.shell.converters.DateConverter
- All Implemented Interfaces:
- Converter<Date>
public class DateConverter
- extends Object
- implements Converter<Date>
Converter
for Date
.
- Since:
- 1.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DateConverter
public DateConverter()
DateConverter
public DateConverter(DateFormat dateFormat)
convertFromText
public Date convertFromText(String value,
Class<?> requiredType,
String optionContext)
- Description copied from interface:
Converter
- Converts from the given String value to type T
- Specified by:
convertFromText
in interface Converter<Date>
- Parameters:
value
- the value to convertrequiredType
- the type being converted to; can't be null
optionContext
- a non-null
string that customises the
behaviour of this converter for a given CliOption
of a given
CliCommand
; the contents will have special meaning to this
converter (e.g. be a comma-separated list of keywords known to this
converter)
- Returns:
- see above
getAllPossibleValues
public boolean getAllPossibleValues(List<Completion> completions,
Class<?> requiredType,
String existingData,
String optionContext,
MethodTarget target)
- Description copied from interface:
Converter
- Populates the given list with the possible completions
- Specified by:
getAllPossibleValues
in interface Converter<Date>
- Parameters:
completions
- the list to populate; can't be null
requiredType
- the type of parameter for which a string is being enteredexistingData
- what the user has typed so faroptionContext
- a non-null
string that customises the
behaviour of this converter for a given CliOption
of a given
CliCommand
; the contents will have special meaning to this
converter (e.g. be a comma-separated list of keywords known to this
converter)
- Returns:
true
if all the added completions are complete
values, or false
if the user can press TAB to add further
information to some or all of them
supports
public boolean supports(Class<?> requiredType,
String optionContext)
- Description copied from interface:
Converter
- Indicates whether this converter supports the given type in the given option context
- Specified by:
supports
in interface Converter<Date>
- Parameters:
requiredType
- the type being checkedoptionContext
- a non-null
string that customises the
behaviour of this converter for a given CliOption
of a given
CliCommand
; the contents will have special meaning to this
converter (e.g. be a comma-separated list of keywords known to this
converter)
- Returns:
- see above