All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.migesok.jaxb.adapter.javatime.ZoneIdXmlAdapter Maven / Gradle / Ivy

The newest version!
package com.migesok.jaxb.adapter.javatime;

import java.time.ZoneId;
import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * {@code XmlAdapter} mapping JSR-310 {@code ZoneId} and {@code ZoneOffset} to the time-zone ID string
 * 

* Time-zone ID format details: *

    *
  • {@link java.time.ZoneId#of(java.lang.String)}
  • *
  • {@link java.time.ZoneId#getId()}
  • *
* * @see javax.xml.bind.annotation.adapters.XmlAdapter * @see java.time.ZoneId * @see java.time.ZoneOffset */ public class ZoneIdXmlAdapter extends XmlAdapter { @Override public ZoneId unmarshal(String stringValue) { return stringValue != null ? ZoneId.of(stringValue) : null; } @Override public String marshal(ZoneId value) { return value != null ? value.getId() : null; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy