public class DateConverter extends AbstractConverter<Date>
Constructor and Description |
---|
DateConverter(Class<? extends Date> targetType)
构造
|
DateConverter(Class<? extends Date> targetType,
String format)
构造
|
Modifier and Type | Method and Description |
---|---|
protected Date |
convertInternal(Object value)
内部转换器,被
AbstractConverter.convert(Object, Object) 调用,实现基本转换逻辑内部转换器转换后如果转换失败可以做如下操作,处理结果都为返回默认值: 1、返回 null
2、抛出一个RuntimeException 异常
|
String |
getFormat()
获取日期格式
|
Class<Date> |
getTargetType()
获得此类实现类的泛型类型
|
void |
setFormat(String format)
设置日期格式
|
convert, convertQuietly, convertToStr
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertWithCheck
public DateConverter(Class<? extends Date> targetType)
targetType
- 目标类型public String getFormat()
public void setFormat(String format)
format
- 日期格式protected Date convertInternal(Object value)
AbstractConverter
AbstractConverter.convert(Object, Object)
调用,实现基本转换逻辑1、返回null
2、抛出一个RuntimeException
异常
convertInternal
in class AbstractConverter<Date>
value
- 值public Class<Date> getTargetType()
AbstractConverter
getTargetType
in class AbstractConverter<Date>
null
Copyright © 2024. All rights reserved.