⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dateconverter.java

📁 struts的一些用的书籍
💻 JAVA
字号:
package app04b.util;

import java.text.SimpleDateFormat;
import java.text.ParseException;
import org.apache.commons.beanutils.Converter;


public final class DateConverter implements Converter {
  private static SimpleDateFormat dateFormat;
  public DateConverter(String datePattern) {
    dateFormat = new SimpleDateFormat(datePattern);
    dateFormat.setLenient(false);
  }
      
  public Object convert(Class type, Object value) {
    try {
      return dateFormat.parse((String) value);
    }
    catch (ParseException e) {
    }
    return null;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -