javax.xml.bind.BigIntegerIntegerAdapter 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 BigIntegerIntegerAdapter extends XmlAdapter{
@Override
public Integer unmarshal(BigInteger v) throws Exception {
if(v == null) return null;
else return v.intValueExact();
}
@Override
public BigInteger marshal(Integer v) throws Exception {
if(v==null) return null;
else return BigInteger.valueOf(v);
}
}