org.broadleafcommerce.common.extensibility.context.merge.handlers
Class NodeValueMerge

java.lang.Object
  extended by org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
      extended by org.broadleafcommerce.common.extensibility.context.merge.handlers.NodeValueMerge
All Implemented Interfaces:
Comparable<Object>, MergeHandler
Direct Known Subclasses:
CommaDelimitedNodeValueMerge, SpaceDelimitedNodeValueMerge

public class NodeValueMerge
extends BaseHandler

MergeHandler implementation that provides merging for the white space delimited text values of a source and patch node. This merge takes into account the same values from both nodes, such that the resulting string is a union of the two without any repeat values.

Author:
jfischer

Field Summary
protected  String delimiter
           
protected  String regex
           
 
Fields inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
children, name, priority, xpath
 
Constructor Summary
NodeValueMerge()
           
 
Method Summary
 String getDelimiter()
           
 String getRegEx()
           
 Node[] merge(List<Node> nodeList1, List<Node> nodeList2, List<Node> exhaustedNodes)
          Perform the merge using the supplied list of nodes from the source and patch documents, respectively.
 
Methods inherited from class org.broadleafcommerce.common.extensibility.context.merge.handlers.BaseHandler
compareTo, getChildren, getName, getPriority, getXPath, setChildren, setName, setPriority, setXPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delimiter

protected String delimiter

regex

protected String regex
Constructor Detail

NodeValueMerge

public NodeValueMerge()
Method Detail

merge

public Node[] merge(List<Node> nodeList1,
                    List<Node> 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 document
nodeList2 - list of nodes to be merged form the patch document
exhaustedNodes - already merged nodes
Returns:
list of merged nodes

getDelimiter

public String getDelimiter()

getRegEx

public String getRegEx()


Copyright © 2013. All Rights Reserved.