}
void createBankDriver(String infoText, FrameWrapper patchEditor,
IBankDriver driver) throws IllegalAccessException,
NoSuchFieldException, IOException {
XmlBankDriverSpecDocument document =
XmlBankDriverSpecDocument.Factory.newInstance();
XmlBankDriverSpec driverSpec = document.addNewXmlBankDriverSpec();
XmlDriverDefs drivers = deviceSpec.getDrivers();
XmlDriverDef driverDef = drivers.addNewXmlDriverDef();
driverDef.setDriverClass(driver.getClass().getName());
driverDef.setDriverType(XmlDriverDef.DriverType.BANK);
addGenericFields(driver, driverSpec, infoText);
if (driver instanceof AbstractBankDriver) {
AbstractBankDriver bankDriver = (AbstractBankDriver) driver;
driverSpec.setNumPatches(getField("numPatches", int.class,
bankDriver, AbstractBankDriver.class));
driverSpec.setNumColumns(getField("numColumns", int.class,
bankDriver, AbstractBankDriver.class));
driverSpec.setSingleSysexID(getField("singleSysexID", String.class,
bankDriver, AbstractBankDriver.class));
driverSpec.setSingleSize(getField("singleSize", int.class,
bankDriver, AbstractBankDriver.class));
}
properties.put(newDriverKey(), driver.getClass().getSimpleName());
document.save(new File(outDir, driver.getClass().getSimpleName()
+ ".xml"));
}