All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quhaodian.web.conver.StringToDateConverterFactory Maven / Gradle / Ivy

package com.quhaodian.web.conver;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.converter.Converter;

import java.util.Date;

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);

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy