Module org.apache.wicket.util
Class AbstractJavaTimeConverter<T extends Temporal>
java.lang.Object
org.apache.wicket.util.convert.converter.AbstractConverter<T>
org.apache.wicket.util.convert.converter.AbstractJavaTimeConverter<T>
- Type Parameters:
T- the type of the Temporal that is supported by this converter
- All Implemented Interfaces:
Serializable,IConverter<T>,IClusterable
- Direct Known Subclasses:
LocalDateConverter,LocalDateTimeConverter,LocalTimeConverter,ZonedDateTimeConverter
A base class for all java.time.** related converters
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToObject(String value, Locale locale) Converts the givenStringvalueconvertToString(T value, Locale locale) Converts the given value to a string.protected abstract TcreateTemporal(TemporalAccessor temporalAccessor) Creates a new instance of D out of the passed date(time) as longprotected abstract DateTimeFormattergetDateTimeFormatter(Locale locale) Methods inherited from class org.apache.wicket.util.convert.converter.AbstractConverter
getTargetType, newConversionException, parse
-
Constructor Details
-
AbstractJavaTimeConverter
public AbstractJavaTimeConverter()
-
-
Method Details
-
createTemporal
Creates a new instance of D out of the passed date(time) as long- Parameters:
temporalAccessor- the date(time) in millis since Epoch- Returns:
- a new instance of the specific type D
-
convertToObject
Description copied from interface:IConverterConverts the givenStringvalue- Parameters:
value- The string value to convertlocale- The locale used to convert the value- Returns:
- The converted value
-
convertToString
Description copied from interface:IConverterConverts the given value to a string.- Specified by:
convertToStringin interfaceIConverter<T extends Temporal>- Overrides:
convertToStringin classAbstractConverter<T extends Temporal>- Parameters:
value- The value to convertlocale- The locale used to convert the value- Returns:
- The converted string value
- See Also:
-
getDateTimeFormatter
- Parameters:
locale-- Returns:
- Returns the date time format.
-
getDateTimeFormatter
-