com.haoxuer.discover.web.conver.StringToDateConverterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discover-website Show documentation
Show all versions of discover-website Show documentation
discover网站配置模块,主要管理网站主题,网站配置等功能
package com.haoxuer.discover.web.conver;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.converter.Converter;
public class StringToDateConverterFactory implements Converter {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Override
public Date convert(String source) {
if (source == null || "".equals(source)) {
return null;
}
source = source.trim();
if (source.equals("")) {
return null;
}
return DateConver.getDefault().conver(source);
}
}