class ExportXFDF implements Callable<Integer>
{
    // Expected for CLI app to write to System.out/System.err
    @SuppressWarnings("squid:S106")
    private final PrintStream SYSERR;

    @Option(names = {"-i", "--input"}, description = "the PDF file to export", required = true)
    private File infile;

    @Option(names = {"-o", "--output"}, description = "the XFDF data file", required = true)
    private File outfile;
    
    /**
     * Constructor.
     */
    public ExportXFDF()
    {
        SYSERR = System.err;
    }

    /**
     * This is the entry point for the application.
     *
     * @param args The command-line arguments.
     *
     */
    public static void main(String[] args)
    {
        // suppress the Dock icon on OS X
        System.setProperty("apple.awt.UIElement", "true");

        int exitCode = new CommandLine(new ExportXFDF()).execute(args);
        System.exit(exitCode);
    }

    public Integer call()
    {<FILL_FUNCTION_BODY>}
}

        try (PDDocument pdf = Loader.loadPDF(infile))
        {
            PDAcroForm form = pdf.getDocumentCatalog().getAcroForm();
            if( form == null )
            {
                SYSERR.println( "Error: This PDF does not contain a form." );
            }
            else
            {
                if (outfile == null)
                {
                    String outPath = FilenameUtils.removeExtension(infile.getAbsolutePath()) + ".xfdf";
                    outfile = new File(outPath);
                }
                
                try (FDFDocument fdf = form.exportFDF())
                {
                    fdf.saveXFDF(outfile);
                }
            }
        }
        catch (IOException ioe)
        {
            SYSERR.println( "Error exporting XFDF data [" + ioe.getClass().getSimpleName() + "]: " + ioe.getMessage());
            return 4;
        }
        return 0;
    
<no_super_class>