Class AbstractJavaTimeConverter<T extends java.time.temporal.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:
java.io.Serializable,IConverter<T>,IClusterable
- Direct Known Subclasses:
LocalDateConverter,LocalDateTimeConverter,LocalTimeConverter,ZonedDateTimeConverter
public abstract class AbstractJavaTimeConverter<T extends java.time.temporal.Temporal> extends AbstractConverter<T>
A base class for all java.time.** related converters- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractJavaTimeConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TconvertToObject(java.lang.String value, java.util.Locale locale)Converts the givenStringvaluejava.lang.StringconvertToString(T value, java.util.Locale locale)Converts the given value to a string.protected abstract TcreateTemporal(java.time.temporal.TemporalAccessor temporalAccessor)Creates a new instance of D out of the passed date(time) as longprotected abstract java.time.format.DateTimeFormattergetDateTimeFormatter()java.time.format.DateTimeFormattergetDateTimeFormatter(java.util.Locale locale)-
Methods inherited from class org.apache.wicket.util.convert.converter.AbstractConverter
getTargetType, newConversionException, parse
-
-
-
-
Method Detail
-
createTemporal
protected abstract T createTemporal(java.time.temporal.TemporalAccessor temporalAccessor)
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
public T convertToObject(java.lang.String value, java.util.Locale locale)
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
public java.lang.String convertToString(T value, java.util.Locale locale)
Description copied from interface:IConverterConverts the given value to a string.- Specified by:
convertToStringin interfaceIConverter<T extends java.time.temporal.Temporal>- Overrides:
convertToStringin classAbstractConverter<T extends java.time.temporal.Temporal>- Parameters:
value- The value to convertlocale- The locale used to convert the value- Returns:
- The converted string value
- See Also:
IConverter.convertToString(java.lang.Object, Locale)
-
getDateTimeFormatter
public java.time.format.DateTimeFormatter getDateTimeFormatter(java.util.Locale locale)
- Parameters:
locale-- Returns:
- Returns the date time format.
-
getDateTimeFormatter
protected abstract java.time.format.DateTimeFormatter getDateTimeFormatter()
-
-