/** * 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); } }
if (names != null && !names.isEmpty()) { for (String name : names) { Attribute attribute = parent.getLocalAttribute(name); Attribute destAttribute = getLocalAttribute(name); if (destAttribute == null) {
if (names != null && !names.isEmpty()) { for (String name : names) { Attribute attribute = parent.getLocalAttribute(name); Attribute destAttribute = getLocalAttribute(name); if (destAttribute == null) {