/** {@inheritDoc} */ public void render(Attribute attribute, TilesRequestContext request) throws IOException { if (!isPermitted(request, attribute.getRoles())) { if (log.isDebugEnabled()) { log.debug("Access to attribute denied. User not in role '" + attribute.getRoles() + "'"); } return; } Object value = evaluator.evaluate(attribute, request); write(value, attribute, request); }
/** * Returns a description of the attributes. * * @return A string representation of the content of this definition. */ public String toString() { return "{name=" + name + ", template=" + (templateAttribute != null ? templateAttribute.getValue() : "<null>") + ", role=" + (templateAttribute != null ? templateAttribute.getRoles() : "<null>") + ", preparerInstance=" + preparer + ", attributes=" + attributes + "}"; } }
/** * Returns a description of the attributes. * * @return A string representation of the content of this definition. */ @Override public String toString() { return "{name=" + name + ", template=" + (templateAttribute != null ? templateAttribute.getValue() : "<null>") + ", role=" + (templateAttribute != null ? templateAttribute.getRoles() : "<null>") + ", preparerInstance=" + preparer + ", attributes=" + attributes + "}"; } }
/** * Inherits an attribute, i.e. overwrites null properties with the ones * provided by the attribute. * * @param attribute The attribute to inherit. * @since 2.1.2 */ public void inherit(Attribute attribute) { if (value == null) { value = attribute.getValue(); } if (expression == null) { expression = attribute.getExpression(); } if (roles == null || roles.isEmpty()) { roles = attribute.getRoles(); } if (renderer == null) { renderer = attribute.getRenderer(); } }
/** * Inherits an attribute, i.e. overwrites null properties with the ones * provided by the attribute. * * @param attribute The attribute to inherit. * @since 2.1.2 */ public void inherit(Attribute attribute) { if (value == null) { value = attribute.getValue(); } Expression targetExpressionObject = attribute.getExpressionObject(); if (targetExpressionObject != null && (expressionObject == null || expressionObject .getExpression() == null)) { expressionObject = new Expression(targetExpressionObject); } if (roles == null || roles.isEmpty()) { roles = attribute.getRoles(); } if (renderer == null) { renderer = attribute.getRenderer(); } }