Search in sources :

Example 1 with MergeCueResolver

use of org.craftercms.core.xml.mergers.impl.cues.MergeCueResolver in project core by craftercms.

the class MergeParentAndChildMergeCueTest method setUpTestMergeCue.

private void setUpTestMergeCue() {
    ElementMergeMatcherImpl elementMergeMatcher = new ElementMergeMatcherImpl();
    elementMergeMatcher.setIdAttributeName(new QName(ID_ATTR_NAME));
    MergeCueResolver mergeCueResolver = new MergeCueResolver() {

        @Override
        public MergeCueContext getMergeCue(Element parent, Element child) {
            return new MergeCueContext(mergeCue, parent, child, Collections.<String, String>emptyMap());
        }
    };
    mergeCue = new MergeParentAndChildMergeCue();
    mergeCue.setElementMergeMatcher(elementMergeMatcher);
    mergeCue.setMergeCueResolver(mergeCueResolver);
    mergeCue.setMergeOrderParamName(MERGE_ORDER_PARAM_NAME);
    mergeCue.setDefaultMergeOrder(DEFAULT_MERGE_ORDER);
}
Also used : QName(org.dom4j.QName) MergeCueContext(org.craftercms.core.xml.mergers.impl.cues.MergeCueContext) Element(org.dom4j.Element) MergeCueResolver(org.craftercms.core.xml.mergers.impl.cues.MergeCueResolver)

Aggregations

MergeCueContext (org.craftercms.core.xml.mergers.impl.cues.MergeCueContext)1 MergeCueResolver (org.craftercms.core.xml.mergers.impl.cues.MergeCueResolver)1 Element (org.dom4j.Element)1 QName (org.dom4j.QName)1