class BigIntegerConverter implements PropertyConverter<BigInteger> {

    @Override
    public BigInteger convert(String value, ConversionContext ctx) {
        ctx.addSupportedFormats(getClass(), "[-]0X.. (hex)", "[-]0x... (hex)", "<bigint> -> new BigInteger(bigint)");
        if(value==null){
            return null;
        }
        String trimmed = value.trim();
        if(trimmed.startsWith("0x") || trimmed.startsWith("0X")){
            LOG.finest("Parsing Hex createValue to BigInteger: " + value);
            return new BigInteger(value.substring(2), 16);
        } else if(trimmed.startsWith("-0x") || trimmed.startsWith("-0X")){
            LOG.finest("Parsing Hex createValue to BigInteger: " + value);
            return new BigInteger('-' + value.substring(3), 16);
        }
        try{
            return new BigInteger(trimmed);
        } catch(Exception e){
            LOG.log(Level.FINEST, "Failed to parse BigInteger from: " + value, e);
            return null;
        }
    }

}