package com.ichir.projects.jaxb;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class DateAdapter extends XmlAdapter<String, Date> {

	private DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
	
	@Override
	public Date unmarshal(String v) throws Exception {
		return format.parse(v);
	}

	@Override
	public String marshal(Date v) throws Exception {
		return format.format(v);
	}

}
