/** * Constructor. * Create a context and set specified attributes. * * @param attributes Attributes to initialize context. * @since 2.1.0 */ public BasicAttributeContext(Map<String, Attribute> attributes) { if (attributes != null) { this.attributes = deepCopyAttributeMap(attributes); } }
/** * Constructor. * Create a context and set specified attributes. * * @param attributes Attributes to initialize context. * @since 2.1.0 */ public BasicAttributeContext(Map<String, Attribute> attributes) { if (attributes != null) { this.attributes = deepCopyAttributeMap(attributes); } }
/** * Copies the cascaded attributes to the current context. * * @param context The context to copy from. */ private void copyCascadedAttributes(BasicAttributeContext context) { if (context.cascadedAttributes != null && !context.cascadedAttributes.isEmpty()) { cascadedAttributes = deepCopyAttributeMap(context.cascadedAttributes); } }
/** * Copies the cascaded attributes to the current context. * * @param context The context to copy from. */ private void copyCascadedAttributes(BasicAttributeContext context) { if (context.cascadedAttributes != null && !context.cascadedAttributes.isEmpty()) { cascadedAttributes = deepCopyAttributeMap(context.cascadedAttributes); } }
/** * 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); }