package com.megatim.fdxconsultation.model.adapters;
|
|
import java.time.LocalDateTime;
|
import java.time.format.DateTimeFormatter;
|
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
|
/**
|
*
|
* @author Gabuntu
|
*/
|
public class LocalDateTimeAdapter extends XmlAdapter<String, LocalDateTime> {
|
|
private static final DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
|
@Override
|
public LocalDateTime unmarshal(String value) throws Exception {
|
return LocalDateTime.parse(value, formatter);
|
}
|
|
@Override
|
public String marshal(LocalDateTime value) throws Exception {
|
return value.toString();
|
}
|
|
}
|