/** * Renders the specified attribute context. * * @param request The request context. * @param attributeContext The context to render. * @throws InvalidTemplateException If the template is not valid. * @throws CannotRenderException If something goes wrong during rendering. * @since 2.1.3 */ protected void render(TilesRequestContext request, AttributeContext attributeContext) { try { if (attributeContext.getPreparer() != null) { prepare(request, attributeContext.getPreparer(), true); } render(attributeContext.getTemplateAttribute(), request); } catch (IOException e) { throw new CannotRenderException(e.getMessage(), e); } }
/** * Renders the specified attribute context. * * @param request The request context. * @param attributeContext The context to render. * @throws InvalidTemplateException If the template is not valid. * @throws CannotRenderException If something goes wrong during rendering. * @since 2.1.3 */ protected void render(Request request, AttributeContext attributeContext) { try { if (attributeContext.getPreparer() != null) { prepare(request, attributeContext.getPreparer(), true); } render(attributeContext.getTemplateAttribute(), request); } catch (IOException e) { throw new CannotRenderException(e.getMessage(), e); } } }
/** * Copy constructor. * * @param context The constructor to copy. * @since 2.1.0 */ public BasicAttributeContext(AttributeContext context) { if (context instanceof BasicAttributeContext) { copyBasicAttributeContext((BasicAttributeContext) context); } else { Attribute parentTemplateAttribute = context.getTemplateAttribute(); if (parentTemplateAttribute != null) { this.templateAttribute = new Attribute(parentTemplateAttribute); } this.preparer = context.getPreparer(); this.attributes = new HashMap<String, Attribute>(); for (String name : context.getLocalAttributeNames()) { attributes.put(name, new Attribute(context.getLocalAttribute(name))); } inheritCascadedAttributes(context); } }
/** * Copy constructor. * * @param context The constructor to copy. * @since 2.1.0 */ public BasicAttributeContext(AttributeContext context) { if (context instanceof BasicAttributeContext) { copyBasicAttributeContext((BasicAttributeContext) context); } else { Attribute parentTemplateAttribute = context.getTemplateAttribute(); if (parentTemplateAttribute != null) { this.templateAttribute = new Attribute(parentTemplateAttribute); } this.preparer = context.getPreparer(); this.attributes = new HashMap<String, Attribute>(); Set<String> parentAttributeNames = context.getLocalAttributeNames(); if (parentAttributeNames != null) { for (String name : parentAttributeNames) { attributes.put(name, new Attribute(context.getLocalAttribute(name))); } } inheritCascadedAttributes(context); } }
} else { Attribute parentTemplateAttribute = parent.getTemplateAttribute(); inheritParentTemplateAttribute(parentTemplateAttribute); if (preparer == null) {
} else { Attribute parentTemplateAttribute = parent.getTemplateAttribute(); inheritParentTemplateAttribute(parentTemplateAttribute); if (preparer == null) {