public class DateAdapterForDay extends XmlAdapter<String, Date> {

    private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");  

    @Override
public String marshal(Date v) throws Exception {
if (null == v) {
return null;
}
return dateFormat.format(v);
} @Override
public Date unmarshal(String v) throws Exception {
if (!StringUtil.isNotBlank(v)) {
return null;
}
return dateFormat.parse(v);
} }

DateAdapterForDay的更多相关文章

随机推荐

  1. 根据sid或sqlID查询SQL

    根据sid查询已经执行过的sql select sql_text from v$sqlarea a,v$session b where a.SQL_ID=b.PREV_SQL_ID and b.SID ...

  2. bzoj 3172: [Tjoi2013]单词 fail树

    题目大意: 一篇论文是由许多单词组成,现在想知道每个单词分别在论文中出现多少次. 题解: 我们首先考虑fail指针的含义 如果fail[x] = y,那么我们就知道y作为x的后缀在x中出现了一次 所以 ...

  3. HTML a标签如何设置margin属性(转)

    很多同学发现对DIV有效的许多CSS属性对<a>或<p>标签都无效,好比说 <div style="margin-top:5px;"></ ...

  4. Linux不停往外发包

    一台Linux这两天不停往外发包,造成外部无法访问. [root@ct-nat ~]# watch ifconfig-------------查看数据包新增情况 Every 2.0s: ifconfi ...

  5. 笔者带你剖析轻量级Sharding中间件——Kratos1.x

    之所以编写Kratos其实存在一个小插曲,当笔者满山遍野寻找成熟.稳定.高性能的Sharding中间件时,确实是翻山越岭,只不过始终没有找到一款合适笔者项目场景的中间件产品.依稀记得当年第一款使用的S ...

  6. nginx与apache 限制ip连接数和带宽方法

    今天有个人问我,nginx怎么限制ip连接数,突然想不起来了,年龄大了,脑子不怎么好使了.还要看一下配置才想起了.那个人又问我,你测试过的吗?一下子把我问蒙了,我真没测试过了,也不知道启作用了没有. ...

  7. Python 二维列表

    一维列表,可以使用 * 快速创建list1=[0]*Width r = [0]*5 print r r[1]= 1 print r [0, 0, 0, 0, 0] [0, 1, 0, 0, 0] 扩展 ...

  8. 使用mahout fpgrowth算法求关联规则

    使用mahout fpgrowth 首先,这篇文章的内容大部分取自国外一篇博客Finding association rules with Mahout Frequent Pattern Mining ...

  9. GIT 图形化操作指南

    Git操作指南(2) -- Git Gui for Windows的建库.克隆(clone).上传(push).下载(pull).合并 关于linux上建库等操作请看文章: http://hi.bai ...

  10. 292C Beautiful IP Addresses

    传送门 题目 The problem uses a simplified TCP/IP address model, please read the statement carefully. An I ...