// Prepend xml method tag
generatorInfo = "<?xml version=\"1.0\" encoding=\"" + XMLDriver.getInstance().getEncoding() + "\"?>" + generatorInfo;
ByteArrayInputStream is = new ByteArrayInputStream(generatorInfo.getBytes());
GeneratorSettings settings;
try
{
settings = (GeneratorSettings) XMLDriver.getInstance().deserializeStream(GeneratorSettings.class, is);
// Perform post-processing
StandardMsgContainer msgs = new StandardMsgContainer();
settings.setModel(item.getModel());
settings.afterDeserialization(msgs);
if (!msgs.isEmpty())
{
// Report errors that occured during the post-processing
JMsgBox.show(null, msgs.toString(), JMsgBox.TYPE_OKLATER | JMsgBox.ICON_ERROR);
}
}
catch (XMLDriverException e)
{
ExceptionUtil.printTrace(e);
return false;
}
String name = settings.getGeneratorName();
Generator gen = GeneratorMgr.getInstance().getGenerator(name);
if (gen != null)
{
context.setSelectedGenerator(gen);
context.setGeneratorSettings(settings);