}
@Override
public void handleObject(DmcUncheckedObject uco, String infile, int lineNumber) throws ResultException, DmcValueException, DmcRuleExceptionSet {
MvwDefinition definition = null;
try {
definition = (MvwDefinition) factory.createWrapper(uco);
} catch (ClassNotFoundException e) {
ResultException ex = new ResultException("Unknown object class: " + uco.classes.get(0));
ex.result.lastResult().fileName(infile);
ex.result.lastResult().lineNumber(lineNumber);
throw(ex);
}
catch (ResultException ex){
ex.setLocationInfo(infile, lineNumber);
throw(ex);
}
catch(DmcValueException e){
ResultException ex = new ResultException();
ex.addError(e.getMessage());
if (e.getAttributeName() != null)
ex.result.lastResult().moreMessages("Attribute: " + e.getAttributeName());
ex.setLocationInfo(infile, lineNumber);
throw(ex);
}
definition.setLineNumber(lineNumber);
definition.setFile(infile);
// A little trick here that let's us use different names for the naming attribute e.g. for Events
// it's nice to use eventCause - however because camelCaseName is mandatory in the MvwDefinition,
// we just whack the objectName into camelCaseName.
definition.setCamelCaseName(definition.getObjectName());
if (definition instanceof Module){
currentModule = (Module) definition;
}
if (definition instanceof Component){
Component c = (Component) definition;
c.setComponentName(c.getObjectName());
}
definition.setDefinedInModule(currentModule);
// try {
ruleManager.executeAttributeValidation(definition.getDMO());
ruleManager.executeObjectValidation(definition.getDMO());
// } catch (DmcValueExceptionSet e) {
// ResultException ex = new ResultException();
// for(DmcValueException dve: e.getExceptions()){
// ex.addError(dve.getLocalizedMessage());
// }