package at.technikumwien.movies; import javax.xml.bind.annotation.adapters.XmlAdapter; import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class LocalDateAdapter extends XmlAdapter { private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy"); @Override public LocalDate unmarshal(String s) throws Exception { return LocalDate.parse(s, FORMATTER); } @Override public String marshal(LocalDate localDate) throws Exception { return FORMATTER.format(localDate); } }