Running Ibator With Java

Running Ibator from Java with an XML Configuration File

The following code sample shows how to call Ibator from Java. It does not show exception handling, but that should be obvious from the compiler errors :)

   List<String> warnings = new ArrayList<String>();
   boolean overwrite = true;
   File configFile = new File("ibatorConfig.xml");
   IbatorConfigurationParser cp = new IbatorConfigurationParser(warnings);
   IbatorConfiguration config = cp.parseIbatorConfiguration(configFile);
   DefaultShellCallback callback = new DefaultShellCallback(overwrite);
   Ibator ibator = new Ibator(config, callback, warnings);
   ibator.generate(null);

Notes:

Running Ibator from Java with a Java Based Configuration

The following code sample shows how to call Ibator from Java only. It does not show exception handling, but that should be obvious from the compiler errors :)

   List<String> warnings = new ArrayList<String>();
   boolean overwrite = true;
   IbatorConfiguration config = new IbatorConfiguration();

   //   ... fill out the config object as appropriate...

   DefaultShellCallback callback = new DefaultShellCallback(overwrite);
   Ibator ibator = new Ibator(config, callback, warnings);
   ibator.generate(null);