![JAR search and dependency download from the Maven repository](/logo.png)
io.github.threetenjaxb.core.IntegerAsTextXmlAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of threeten-jaxb-core Show documentation
Show all versions of threeten-jaxb-core Show documentation
JAXB adapters for Java 8 Date and Time API (JSR-310) types
The newest version!
package io.github.threetenjaxb.core;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
/**
* {@code XmlAdapter} mapping an integer as a string value
*
* This adapter is suitable for {@code xsd:gDay} types.
*
* @see jakarta.xml.bind.annotation.adapters.XmlAdapter
*/
public class IntegerAsTextXmlAdapter extends XmlAdapter {
@Override
public Integer unmarshal(String stringValue) {
return stringValue != null ? Integer.parseInt(stringValue) : null;
}
@Override
public String marshal(Integer value) {
return value != null ? value.toString() : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy