in configuration/xml/src/main/java/org/apache/commons/chain2/config/xml/ConfigCatalogRule.java [84:118]
public void begin(String namespace, String name, Attributes attributes) throws Exception {
// Retrieve any current Catalog with the specified name
Catalog<Object, Object, Map<Object, Object>> catalog;
CatalogFactory<Object, Object, Map<Object, Object>> factory = CatalogFactoryBase.getInstance();
String nameValue = attributes.getValue(nameAttribute);
if (nameValue == null) {
catalog = factory.getCatalog();
} else {
catalog = factory.getCatalog(nameValue);
}
// Create and register a new Catalog instance if necessary
if (catalog == null) {
Class<?> clazz = getDigester().getClassLoader().loadClass(catalogClass);
/* Convert catalog pulled from digester to default generic signature
* with the assumption that the Catalog returned from digester will
* comply with the historic chain contract. */
@SuppressWarnings("unchecked")
Catalog<Object, Object, Map<Object, Object>> digesterCatalog =
(Catalog<Object, Object, Map<Object, Object>>) clazz.newInstance();
catalog = digesterCatalog;
if (nameValue == null) {
factory.setCatalog(catalog);
} else {
factory.addCatalog(nameValue, catalog);
}
}
// Push this Catalog onto the top of the stack
getDigester().push(catalog);
}