Class AttributeMerger

  • All Implemented Interfaces:
    ModelMerger

    public class AttributeMerger
    extends Object
    implements ModelMerger
    Merges attributes from one element into another.
    Author:
    zhanhb, Emanuel Rabina
    • Constructor Detail

      • AttributeMerger

        public AttributeMerger​(ITemplateContext context)
        Constructor, sets up the attribute merger context.
        Parameters:
        context -
    • Method Detail

      • merge

        public IModel merge​(IModel targetModel,
                            IModel sourceModel)
        Merge the attributes of the source element with those of the target element. This is basically a copy of all attributes in the source model with those in the target model, overwriting any attributes that have the same name, except for the case of th:with where variable declarations are preserved, only overwriting same-named declarations.
        Specified by:
        merge in interface ModelMerger
        Parameters:
        sourceModel -
        targetModel -
        Returns:
        New element with the merged attributes.