de.sekmi.li2b2.util.JaxbInstantAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of li2b2-server Show documentation
Show all versions of li2b2-server Show documentation
This project emulates the core components
of an i2b2 server backend. Basic functionality
of PM, CRC, ONT and WORK cells allows the
official i2b2 webclient to connect ot this
emulated server.
The newest version!
package de.sekmi.li2b2.util;
import java.time.Instant;
import javax.xml.bind.annotation.adapters.XmlAdapter;
/**
* JAXB adapter to marshal/unmarshal Instant types
* @author R.W.Majeed
*
*/
public class JaxbInstantAdapter extends XmlAdapter {
@Override
public Instant unmarshal(String v) throws Exception {
return Instant.parse(v);
}
@Override
public String marshal(Instant v) throws Exception {
return v.toString();
}
}