Class NodeReplaceInsert
java.lang.Object
org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
org.broadleafcommerce.common.extensibility.context.merge.handlers.NodeReplaceInsert
- All Implemented Interfaces:
Comparable<Object>,MergeHandler
- Direct Known Subclasses:
LiberalNodeReplaceInsert,MetadataOverrideNodeReplaceInsert,NodeReplace,NonEmptyNodeReplaceInsert
This handler is responsible for replacing nodes in the source document
with the same nodes from the patch document. Note, additional nodes
from the patch document that are not present in the source document
are simply appended to the source document.
- Author:
- jfischer
-
Field Summary
Fields inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
children, name, priority, xpath -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected booleanexactNodeExists(Node[] primaryNodes, Node testNode, List<Node> usedNodes) protected booleanexhaustedNodesContains(List<Node> exhaustedNodes, Node node) Node[]Perform the merge using the supplied list of nodes from the source and patch documents, respectively.protected booleanreplaceCeilingEntityNode(Node[] primaryNodes, Node testNode, List<Node> usedNodes) special "replace" method for metatataOverride items having the "ceilingEntity" attribute specified.protected booleanMethods inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
compareTo, getChildren, getName, getPriority, getXPath, setChildren, setName, setPriority, setXPath
-
Constructor Details
-
NodeReplaceInsert
public NodeReplaceInsert()
-
-
Method Details
-
merge
Description copied from interface:MergeHandlerPerform the merge using the supplied list of nodes from the source and patch documents, respectively. Also, a list of nodes that have already been merged is provided and may be used by the implementation when necessary.- Parameters:
nodeList1- list of nodes to be merged from the source documentnodeList2- list of nodes to be merged form the patch documentexhaustedNodes- already merged nodes- Returns:
- list of merged nodes
-
exhaustedNodesContains
-
checkNode
-
exactNodeExists
-
replaceNode
-
replaceCeilingEntityNode
protected boolean replaceCeilingEntityNode(Node[] primaryNodes, Node testNode, List<Node> usedNodes) special "replace" method for metatataOverride items having the "ceilingEntity" attribute specified. Instead of just overwriting a previously specified item, successive overrideItems with the same ceilingEntity are "merged" into the previous one; the resulting node contains the logical union of both old and new children- Parameters:
primaryNodes-testNode-usedNodes-- Returns:
-