package com.fincatto.documentofiscal.transformers;

import java.time.Instant;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

import org.simpleframework.xml.transform.Transform;

public class DFLocalDateTransformer implements Transform<LocalDate> {

    private static final DateTimeFormatter DATATIME_FORMATTER_YYYYMMDDXXX = DateTimeFormatter.ofPattern("yyyy-MM-ddXXX");
    private static final DateTimeFormatter DATATIME_FORMATTER_YYYYMMDDHHMMSSXXXX = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXXXX");
    private static final DateTimeFormatter DATETIME_FORMATTER_YYYYMMDD = DateTimeFormatter.ofPattern("yyyy-MM-dd");
    private static final DateTimeFormatter DATETIME_FORMATTER_DDMMYYYY = DateTimeFormatter.ofPattern("dd/MM/yyyy");
    private static final DateTimeFormatter DATETIME_FORMATTER_DDMMYYYHHMMSS = DateTimeFormatter.ofPattern("dd/MM/yyyy' 'HH:mm:ss");

    @Override
    public LocalDate read(final String data) {
        try {
            return LocalDate.parse(data, DFLocalDateTransformer.DATETIME_FORMATTER_YYYYMMDD);
        } catch (final Exception e) {
            try {
                return LocalDate.from(DFLocalDateTransformer.DATATIME_FORMATTER_YYYYMMDDXXX.parse(data));
            } catch (final Exception e2) {
                try {
                    return LocalDate.from(DFLocalDateTransformer.DATETIME_FORMATTER_DDMMYYYY.parse(data));
                } catch (final Exception e3) {
                    try {
                        return LocalDate.from(DFLocalDateTransformer.DATETIME_FORMATTER_DDMMYYYHHMMSS.parse(data));
                    } catch (final Exception e4) {
                        return LocalDate.from(DFLocalDateTransformer.DATATIME_FORMATTER_YYYYMMDDHHMMSSXXXX.parse(data));
                    }
                }
            }
        }
    }

    @Override
    public String write(final LocalDate data) {
        return DFLocalDateTransformer.DATETIME_FORMATTER_YYYYMMDD.format(data);
    }
}
@@ -49,34 +49,8 @@
 s;%0A%0A
-import java.time.Instant;%0A
 impo

Remove import não utilizado