com.nedap.archie.xml.adapters.DurationXmlAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aom Show documentation
Show all versions of aom Show documentation
An OpenEHR archetype object model implementation, plus parser
package com.nedap.archie.xml.adapters;
import com.nedap.archie.datetime.DateTimeParsers;
import com.nedap.archie.datetime.DateTimeSerializerFormatters;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import java.time.temporal.TemporalAmount;
/**
* Created by pieter.bos on 30/06/16.
*/
public class DurationXmlAdapter extends XmlAdapter {
@Override
public TemporalAmount unmarshal(String stringValue) {
return stringValue != null? DateTimeParsers.parseDurationValue(stringValue):null;
}
@Override
public String marshal(TemporalAmount value) {
return DateTimeSerializerFormatters.serializeDuration(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy