Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
public static String printYearValue(BigInteger value) {
        if (value == null)
            throw new IllegalArgumentException("Can't print empty year value!");
        if (value.compareTo(BigInteger.valueOf(1700L)) < 0)
            throw new IllegalArgumentException("Can't print year value '" + value + "' because it is below 1700!");
        if (value.compareTo(BigInteger.valueOf(9999L)) > 0)
            throw new IllegalArgumentException("Can't print year value '" + value + "' because it is above 9999!");

        return DatatypeConverter.printInteger(value);
    }
public static String printYearValue(BigInteger value) {
        if (value == null)
            throw new IllegalArgumentException("Can't print empty year value!");
        if (value.compareTo(BigInteger.valueOf(1700L)) < 0)
            throw new IllegalArgumentException("Can't print year value '" + value + "' because it is below 1700!");
        if (value.compareTo(BigInteger.valueOf(9999L)) > 0)
            throw new IllegalArgumentException("Can't print year value '" + value + "' because it is above 9999!");

        return DatatypeConverter.printInteger(value);
    }
Write a {@link BigInteger} value into XML output for a year number.

@param value value to write
@return XML string
@throws IllegalArgumentException if a validation error occurred