Examples/src/main/java/org/openestate/io/examples/FilemakerResultMappingExample.java
public static void main(String[] args) {
        // init logging
        PropertyConfigurator.configure(
                FilemakerWritingExample.class.getResource(PACKAGE + "/log4j.properties"));

        // create a mapping from the example document, if no files were specified as command line arguments
        FilemakerResultMapping mapping = null;
        if (args.length < 1) {
            try {
                mapping = new FilemakerResultDocument(buildExampleDocument()).toMapping();
            } catch (Exception ex) {
                LOGGER.error("Can't create mapping!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
                System.exit(1);
            }
        }

        // read file, that was specified as command line argument
        else {
            try {
                mapping = new FilemakerResultDocument(XmlUtils.newDocument(new File(args[0]))).toMapping();
            } catch (Exception ex) {
                LOGGER.error("Can't create mapping from file '" + args[0] + "'!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
                System.exit(1);
            }
        }

        if (mapping == null) {
            LOGGER.error("No mapping was created!");
            System.exit(1);
        }

        // loop through available rows and access their values through the field name
        for (int i = 0; i < mapping.getRowCount(); i++) {
            FilemakerResultMapping.Row row = mapping.getRow(i);
            LOGGER.info(StringUtils.repeat("-", 50));
            LOGGER.info("record at row " + i);
            LOGGER.info("> recordId = " + row.getRecordId());
            LOGGER.info("> modId = " + row.getModId());

            // access record values through their field name
            for (String field : row.getFieldNames()) {
                LOGGER.info("> " + field + " = " + row.getValue(field));
            }
        }
    }
public static void main(String[] args) {
        // init logging
        PropertyConfigurator.configure(
                FilemakerWritingExample.class.getResource(PACKAGE + "/log4j.properties"));

        // create a mapping from the example document, if no files were specified as command line arguments
        FilemakerResultMapping mapping = null;
        if (args.length < 1) {
            try {
                mapping = new FilemakerResultDocument(buildExampleDocument()).toMapping();
            } catch (Exception ex) {
                LOGGER.error("Can't create mapping!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
                System.exit(1);
            }
        }

        // read file, that was specified as command line argument
        else {
            try {
                mapping = new FilemakerResultDocument(XmlUtils.newDocument(new File(args[0]))).toMapping();
            } catch (Exception ex) {
                LOGGER.error("Can't create mapping from file '" + args[0] + "'!");
                LOGGER.error("> " + ex.getLocalizedMessage(), ex);
                System.exit(1);
            }
        }

        if (mapping == null) {
            LOGGER.error("No mapping was created!");
            System.exit(1);
        }

        // loop through available rows and access their values through the field name
        for (int i = 0; i < mapping.getRowCount(); i++) {
            FilemakerResultMapping.Row row = mapping.getRow(i);
            LOGGER.info(StringUtils.repeat("-", 50));
            LOGGER.info("record at row " + i);
            LOGGER.info("> recordId = " + row.getRecordId());
            LOGGER.info("> modId = " + row.getModId());

            // access record values through their field name
            for (String field : row.getFieldNames()) {
                LOGGER.info("> " + field + " = " + row.getValue(field));
            }
        }
    }
public static void main ( String [ ] args ) { // init logging PropertyConfigurator . configure ( FilemakerWritingExample . class . getResource ( PACKAGE + "/log4j.properties" ) ) ; // create a mapping from the example document, if no files were specified as command line arguments FilemakerResultMapping mapping = null ; if ( args . length < 1 ) { try { mapping = new FilemakerResultDocument ( buildExampleDocument ( ) ) . toMapping ( ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't create mapping!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; System . exit ( 1 ) ; } } // read file, that was specified as command line argument else { try { mapping = new FilemakerResultDocument ( XmlUtils . newDocument ( new File ( args [ 0 ] ) ) ) . toMapping ( ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't create mapping from file '" + args [ 0 ] + "'!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; System . exit ( 1 ) ; } } if ( mapping == null ) { LOGGER . error ( "No mapping was created!" ) ; System . exit ( 1 ) ; } // loop through available rows and access their values through the field name for ( int i = 0 ; i < mapping . getRowCount ( ) ; i ++ ) { FilemakerResultMapping . Row row = mapping . getRow ( i ) ; LOGGER . info ( StringUtils . repeat ( "-" , 50 ) ) ; LOGGER . info ( "record at row " + i ) ; LOGGER . info ( "> recordId = " + row . getRecordId ( ) ) ; LOGGER . info ( "> modId = " + row . getModId ( ) ) ; // access record values through their field name for ( String field : row . getFieldNames ( ) ) { LOGGER . info ( "> " + field + " = " + row . getValue ( field ) ) ; } } }
Start the example application.

@param args command line arguments
Start the example application .