javax.xml.bind.BigIntegerLongAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-xml Show documentation
Show all versions of commons-xml Show documentation
Common classes for XML schema generation and mapping
package javax.xml.bind;
import java.math.BigInteger;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class BigIntegerLongAdapter extends XmlAdapter{
@Override
public Long unmarshal(BigInteger v) throws Exception {
if(v == null) return null;
else return v.longValueExact();
}
@Override
public BigInteger marshal(Long v) throws Exception {
if(v==null) return null;
else return BigInteger.valueOf(v);
}
}