private ModuleScriptType getScriptType(Scriptable module) throws ModuleValidationException {
if(!hasStringInModuleObject(module, "type"))
return ModuleScriptType.BASIC_MODULE;
final String typeName = getStringFromModuleObject(module, "type");
final ModuleScriptType type = ModuleScriptType.lookup(typeName);
if(type == null)
throw new ModuleValidationException("Unrecognized module type: "+ typeName);
else
return type;
}