final String attributeValue = element.getAttributeValue(attributeName);
final RenderingEngine renderingEngine = Components.getComponent(RenderingEngine.class);
final RenderingContext renderingContext = renderingEngine.getRenderingContext();
AreaDefinition areaDef = null;
BlossomTemplateDefinition templateDefinition;
try {
templateDefinition = (BlossomTemplateDefinition) renderingContext.getRenderableDefinition();
if (templateDefinition.getAreas().containsKey(attributeValue)) {
areaDef = templateDefinition.getAreas().get(attributeValue);
}
} catch (ClassCastException x) {
throw new TemplateProcessingException("Only Blossom, templates supported", x);
}
if (areaDef == null) {
throw new TemplateProcessingException("Area not found:" + attributeValue);
}
AreaElement areaElement = createElement(renderingContext);
areaElement.setName(areaDef.getName());
processElement(element, attributeName, areaElement);
return ProcessorResult.OK;
}