}
if (enumMappings.size() > 0){
for(EnumMapping mapping: enumMappings.values()){
if (mapping.getDefinedInModule() == codeGenModule){
EnumDefinition ed = readSchemas.isEnum(mapping.getEnumName());
if (ed == null){
if (errors == null)
errors = new ResultException();
errors.addError(mapping.getEnumName() + " is not a known enum type.");
errors.result.lastResult().fileName(mapping.getFile());
errors.result.lastResult().lineNumber(mapping.getLineNumber());
}
else{
mapping.setEnumDef(ed);
EnumValue ev = ed.getEnumValue(mapping.getUnsetValue());
if (ev == null){
if (errors == null)
errors = new ResultException();
errors.addError(mapping.getUnsetValue() + " is not a valid member of enum: " + ed.getName());
errors.result.lastResult().fileName(mapping.getFile());
errors.result.lastResult().lineNumber(mapping.getLineNumber());
}
}