java.lang.Object
org.broadleafcommerce.common.extensibility.context.merge.handlers.MergeHandlerAdapter
All Implemented Interfaces:
MergeHandler

public class MergeHandlerAdapter extends Object implements MergeHandler
This adapter class allows the developer to create a merge handler instance and only override a subset of the functionality, instead of having to provide an independent, full implementation of the MergeHandler interface.
Author:
jfischer
  • Constructor Details

    • MergeHandlerAdapter

      public MergeHandlerAdapter()
  • Method Details

    • getChildren

      public MergeHandler[] getChildren()
      Description copied from interface: MergeHandler
      Retrieve any child merge handlers associated with this handler. Child merge handlers may be added alter merge behavior for a subsection of the merge area defined by this merge handler.
      Specified by:
      getChildren in interface MergeHandler
      Returns:
      child merge handlers
    • setChildren

      public void setChildren(MergeHandler[] children)
      Description copied from interface: MergeHandler
      Set the child merge handlers
      Specified by:
      setChildren in interface MergeHandler
    • getName

      public String getName()
      Description copied from interface: MergeHandler
      Retrieve the name associated with this merge handlers. Merge handler names are period-delimited numeric strings that define the hierarchical relationship of mergehandlers and their children. For example, "2" could be used to define the second handler in the configuration list and "2.1" would be the name describing the first child handler of "2".
      Specified by:
      getName in interface MergeHandler
      Returns:
      the period-delimited numeric string that names this handler
    • setName

      public void setName(String name)
      Description copied from interface: MergeHandler
      Set the period-delimited numeric string that names this handler
      Specified by:
      setName in interface MergeHandler
    • getPriority

      public int getPriority()
      Description copied from interface: MergeHandler
      Retrieve the priority for the handler. Priorities are used by the MergeManager to establish the order of operations for performing merges.
      Specified by:
      getPriority in interface MergeHandler
      Returns:
      the priority value
    • setPriority

      public void setPriority(int priority)
      Description copied from interface: MergeHandler
      Set the priority for this handler
      Specified by:
      setPriority in interface MergeHandler
    • getXPath

      public String getXPath()
      Description copied from interface: MergeHandler
      Retrieve the XPath query associated with this handler. XPath is used by the handler to define to section of the source and patch documents that will be merged.
      Specified by:
      getXPath in interface MergeHandler
      Returns:
      the xpath query
    • setXPath

      public void setXPath(String xpath)
      Description copied from interface: MergeHandler
      Set the xpath query
      Specified by:
      setXPath in interface MergeHandler
    • 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.
      Specified by:
      merge in interface MergeHandler
      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