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 T
convertToObject(String value, Locale locale)
Converts the givenString
valueString
convertToString(T value, Locale locale)
Converts the given value to a string.protected abstract T
createTemporal(TemporalAccessor temporalAccessor)
Creates a new instance of D out of the passed date(time) as longprotected abstract DateTimeFormatter
getDateTimeFormatter()
DateTimeFormatter
getDateTimeFormatter(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:IConverter
Converts the givenString
value- 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:IConverter
Converts the given value to a string.- Specified by:
convertToString
in interfaceIConverter<T extends Temporal>
- Overrides:
convertToString
in 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()
-
-