Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @XmlJavaTypeAdapter(LocalDateTimeAdapter.class)
- ---------------------
- public class LocalDateTimeAdapter extends XmlAdapter<String, LocalDateTime> {
- @Override
- public LocalDateTime unmarshal(String s) throws Exception {
- return LocalDateTime.parse(s, DateTimeFormatter.ofPattern("yyyy/MM/dd' 'HH:mm:ss"));
- }
- @Override
- public String marshal(LocalDateTime localDateTime) throws Exception {
- return localDateTime.toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment