private static void writeErrorManagerConfiguration(final Writer out, final ErrorManagerConfiguration errorManager, final boolean writeExpressions) throws IOException { if (errorManager != null) { out.write(NEW_LINE); final String name = errorManager.getName(); final String prefix = "errorManager." + name + "."; final String className = errorManager.getClassName(); writeProperty(out, "errorManager.", name, className); final String moduleName = errorManager.getModuleName(); if (moduleName != null) { writeProperty(out, prefix, "module", moduleName); } final List<String> postConfigurationMethods = errorManager.getPostConfigurationMethods(); if (! postConfigurationMethods.isEmpty()) { writeProperty(out, prefix, "postConfiguration", toCsvString(postConfigurationMethods)); } writeProperties(out, prefix, errorManager, writeExpressions); } }
private boolean configureErrorManager(final Properties properties, final String errorManagerName) { final String className = getStringProperty(properties, getKey(ERROR_MANAGER, errorManagerName)); if (className == null) { printError("Error manager %s is not defined%n", errorManagerName); return false; } final ErrorManagerConfiguration configuration; if (config.getErrorManagerNames().contains(errorManagerName)) { configuration = config.getErrorManagerConfiguration(errorManagerName); } else { configuration = config.addErrorManagerConfiguration(getStringProperty(properties, getKey(ERROR_MANAGER, errorManagerName, MODULE)), className, errorManagerName, getStringCsvArray(properties, getKey(ERROR_MANAGER, errorManagerName, CONSTRUCTOR_PROPERTIES))); } final String[] postConfigurationMethods = getStringCsvArray(properties, getKey(ERROR_MANAGER, errorManagerName, POST_CONFIGURATION)); configuration.setPostConfigurationMethods(postConfigurationMethods); configureProperties(properties, configuration, getKey(ERROR_MANAGER, errorManagerName)); return true; }
private boolean configureErrorManager(final Properties properties, final String errorManagerName) { if (config.getErrorManagerConfiguration(errorManagerName) != null) { // already configured! return true; } final String className = getStringProperty(properties, getKey("errorManager", errorManagerName)); if (className == null) { printError("Error manager %s is not defined%n", errorManagerName); return false; } final ErrorManagerConfiguration configuration = config.addErrorManagerConfiguration( getStringProperty(properties, getKey("errorManager", errorManagerName, "module")), className, errorManagerName, getStringCsvArray(properties, getKey("errorManager", errorManagerName, "constructorProperties"))); final String[] postConfigurationMethods = getStringCsvArray(properties, getKey("errorManager", errorManagerName, "postConfiguration")); configuration.setPostConfigurationMethods(postConfigurationMethods); configureProperties(properties, configuration, getKey("errorManager", errorManagerName)); return true; }