All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.docx4j.wml.BigIntegerAdapter Maven / Gradle / Ivy

Go to download

docx4j is a library which helps you to work with the Office Open XML file format as used in docx documents, pptx presentations, and xlsx spreadsheets.

There is a newer version: 6.1.2
Show newest version
package org.docx4j.wml;

import java.math.BigInteger;
import javax.xml.bind.annotation.adapters.XmlAdapter;

public class BigIntegerAdapter extends XmlAdapter {

        @Override
        public String marshal(BigInteger bigDecimal) throws Exception {
                if (bigDecimal != null){
                        return bigDecimal.toString();
                }
                else {
                        return null;
                }
        }

        @Override
        public BigInteger unmarshal(String s) throws Exception {
                try {
                        return new BigInteger(s);
                } catch (NumberFormatException e) {
                        return null;
                }
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy