Class AttributeMerger
- java.lang.Object
-
- nz.net.ultraq.thymeleaf.layoutdialect.models.AttributeMerger
-
- All Implemented Interfaces:
ModelMerger
public class AttributeMerger extends Object implements ModelMerger
Merges attributes from one element into another.- Author:
- zhanhb, Emanuel Rabina
-
-
Constructor Summary
Constructors Constructor Description AttributeMerger(ITemplateContext context)
Constructor, sets up the attribute merger context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITemplateContext
getContext()
IModel
merge(IModel targetModel, IModel sourceModel)
Merge the attributes of the source element with those of the target element.
-
-
-
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 ofth:with
where variable declarations are preserved, only overwriting same-named declarations.- Specified by:
merge
in interfaceModelMerger
- Parameters:
sourceModel
-targetModel
-- Returns:
- New element with the merged attributes.
-
getContext
public final ITemplateContext getContext()
-
-