org.broadleafcommerce.common.extensibility.context.merge.handlers
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
public class NodeReplaceInsert
- extends BaseHandler
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
|
Method Summary |
protected boolean |
checkNode(List<Node> usedNodes,
Node[] primaryNodes,
Node node)
|
protected boolean |
exactNodeExists(Node[] primaryNodes,
Node testNode,
List<Node> usedNodes)
|
Node[] |
merge(NodeList nodeList1,
NodeList nodeList2,
List<Node> exhaustedNodes)
Perform the merge using the supplied list of nodes from the source and
patch documents, respectively. |
protected boolean |
replaceNode(Node[] primaryNodes,
Node testNode,
String attribute,
List<Node> usedNodes)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NodeReplaceInsert
public NodeReplaceInsert()
merge
public Node[] merge(NodeList nodeList1,
NodeList nodeList2,
List<Node> exhaustedNodes)
- Description copied from interface:
MergeHandler
- Perform 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
checkNode
protected boolean checkNode(List<Node> usedNodes,
Node[] primaryNodes,
Node node)
exactNodeExists
protected boolean exactNodeExists(Node[] primaryNodes,
Node testNode,
List<Node> usedNodes)
replaceNode
protected boolean replaceNode(Node[] primaryNodes,
Node testNode,
String attribute,
List<Node> usedNodes)
Copyright © 2013. All Rights Reserved.