return(rc);
}
@Override
public void handleObject(DmcUncheckedObject uco, String infile, int lineNumber) throws ResultException, DmcValueException {
PluginConfig config = null;
try {
config = (PluginConfig) factory.createWrapper(uco);
} catch (ClassNotFoundException e) {
ResultException ex = new ResultException("Unknown object class: " + uco.classes.get(0));
ex.result.lastResult().moreMessages("The plugin configuration file should contain PluginConfig objects.");
ex.result.lastResult().fileName(infile);
ex.result.lastResult().lineNumber(lineNumber);
throw(ex);
} catch (ClassCastException e){
ResultException ex = new ResultException("Invalid object in plugin config file: " + uco.classes.get(0));
ex.result.lastResult().fileName(infile);
ex.result.lastResult().lineNumber(lineNumber);
throw(ex);
}
config.setLineNumber(lineNumber);
config.setFile(infile);
if (config.getPluginName() != null)
config.setCamelCaseName(config.getPluginName());
try {
ruleManager.executeAttributeValidation(config.getDmcObject());
ruleManager.executeObjectValidation(config.getDmcObject());
// } catch (DmcValueExceptionSet e) {
// ResultException ex = new ResultException();
// for(DmcValueException dve: e.getExceptions()){
// ex.addError(dve.getLocalizedMessage());
// }
// ex.setLocationInfo(infile, lineNumber);
// ex.result.lastResult().moreMessages("Object class: " + config.getConstructionClassName());
//
// throw(ex);
} catch (DmcRuleExceptionSet e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (pluginConfigs.get(config.getObjectName()) != null){
ResultException ex = new ResultException("Duplicate plugin name: " + config.getObjectName());
ex.result.lastResult().fileName(infile);
ex.result.lastResult().lineNumber(lineNumber);
throw(ex);
}
pluginConfigs.put(config.getObjectName(), config);
// startOrder.put(plugin., value)
}