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:
generated.source.dir
can be
accessed in the Ibator configuration file with the escape sequence
${generated.source.dir}
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);