private TagHandlerRegistry loadHandlerRegistry() throws TCDLTransformerException {
log.debug("Loading HandlerRegistry");
TCDLProcessor processor = TCDLProcessor.getInstance();
Object renderProcessor = forceGetField(processor, "renderProcessor");
TagHandlerRegistry registry;
if (renderProcessor != null && (renderProcessor instanceof TCDLEngine)) {
TCDLEngine renderer = (TCDLEngine) renderProcessor;
Object registryObject = forceGetField(renderer, "registry");
if (registryObject != null && (registryObject instanceof TagHandlerRegistry)) {
registry = (TagHandlerRegistry) registryObject;
log.debug("Loaded handlerRegistry={}", registry);
} else {
registry = new TagHandlerRegistry(true, TCDLMode.RENDER);
log.debug("Registry member of renderProcessor was null. Loaded default handlerRegistry={}", registry);
}
} else {
registry = new TagHandlerRegistry(true, TCDLMode.RENDER);
log.debug("RenderProcessor was null. Loaded default handlerRegistry={}", registry);
}
return registry;
}