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
public abstract class AbstractJavaTimeConverter<T extends 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(String value, Locale locale)Converts the givenStringvalueStringconvertToString(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()DateTimeFormattergetDateTimeFormatter(Locale locale)-
Methods inherited from class org.apache.wicket.util.convert.converter.AbstractConverter
getTargetType, newConversionException, parse
-
-
-
-
Constructor Detail
-
AbstractJavaTimeConverter
public AbstractJavaTimeConverter()
-
-
Method Detail
-
createTemporal
protected abstract T createTemporal(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(String value, 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 String convertToString(T value, Locale locale)
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:
IConverter.convertToString(java.lang.Object, Locale)
-
getDateTimeFormatter
public DateTimeFormatter getDateTimeFormatter(Locale locale)
- Parameters:
locale-- Returns:
- Returns the date time format.
-
getDateTimeFormatter
protected abstract DateTimeFormatter getDateTimeFormatter()
-
-