/** {@inheritDoc} */ public void inheritCascadedAttributes(AttributeContext context) { if (context instanceof BasicAttributeContext) { copyCascadedAttributes((BasicAttributeContext) context); } else { this.cascadedAttributes = new HashMap<String, Attribute>(); for (String name : context.getCascadedAttributeNames()) { cascadedAttributes.put(name, new Attribute(context .getCascadedAttribute(name))); } } }
/** {@inheritDoc} */ public void inheritCascadedAttributes(AttributeContext context) { if (context instanceof BasicAttributeContext) { copyCascadedAttributes((BasicAttributeContext) context); } else { this.cascadedAttributes = new HashMap<String, Attribute>(); Set<String> parentAttributeNames = context.getCascadedAttributeNames(); if (parentAttributeNames != null) { for (String name : parentAttributeNames) { cascadedAttributes.put(name, new Attribute(context .getCascadedAttribute(name))); } } } }
/** * Copies a BasicAttributeContext in an easier way. * * @param context The context to copy. */ private void copyBasicAttributeContext(BasicAttributeContext context) { Attribute parentTemplateAttribute = context.getTemplateAttribute(); if (parentTemplateAttribute != null) { this.templateAttribute = new Attribute(parentTemplateAttribute); } preparer = context.preparer; if (context.attributes != null && !context.attributes.isEmpty()) { attributes = deepCopyAttributeMap(context.attributes); } copyCascadedAttributes(context); }
/** * Copies a BasicAttributeContext in an easier way. * * @param context The context to copy. */ private void copyBasicAttributeContext(BasicAttributeContext context) { Attribute parentTemplateAttribute = context.getTemplateAttribute(); if (parentTemplateAttribute != null) { this.templateAttribute = new Attribute(parentTemplateAttribute); } preparer = context.preparer; if (context.attributes != null && !context.attributes.isEmpty()) { attributes = deepCopyAttributeMap(context.attributes); } copyCascadedAttributes(context); }