M - the model type, either DateTime/DateMidnight or the model type of the chained converterpublic class JodaDateTimeConverter<M> extends Object implements AttributeConverter<M,Date>
| Constructor and Description |
|---|
JodaDateTimeConverter(AttributeConverter<M,org.joda.time.base.BaseDateTime> chainedConverter,
Class<M> modelType)
Create a new converter with the given chained converter.
|
JodaDateTimeConverter(Class<M> modelType)
Create a new converter without a chained converter.
|
| Modifier and Type | Method and Description |
|---|---|
Date |
fromModel(M value,
ConvertContext context) |
Class<M> |
getModelType() |
Class<Date> |
getTargetType() |
M |
toModel(Date value,
ConvertContext context) |
public JodaDateTimeConverter(Class<M> modelType)
modelType - the model type to use, either DateTime or DateMidnightpublic JodaDateTimeConverter(AttributeConverter<M,org.joda.time.base.BaseDateTime> chainedConverter, Class<M> modelType)
chainedConverter - the chained converter, or nullmodelType - the model type to use if no chained converter is given, either DateTime or DateMidnightpublic Date fromModel(M value, ConvertContext context) throws ConvertException
fromModel in interface Converter<M,Date>ConvertExceptionpublic M toModel(Date value, ConvertContext context) throws ConvertException
toModel in interface Converter<M,Date>ConvertExceptionpublic Class<Date> getTargetType()
getTargetType in interface AttributeConverter<M,Date>public Class<M> getModelType()
getModelType in interface AttributeConverter<M,Date>Copyright © 2006–2017 Esito AS. All rights reserved.