Class XPathOperationFactory

java.lang.Object
ch.galinet.xml.xmlmerge.factory.XPathOperationFactory
All Implemented Interfaces:
OperationFactory

public class XPathOperationFactory extends Object implements OperationFactory
An operation factory that resolves operations given a map { xpath (as String), Operation }. The order in the map is relevant if several XPath matches.
Author:
Laurent Bovet (LBO), Alex Mathey (AMA)
  • Constructor Details

    • XPathOperationFactory

      public XPathOperationFactory()
  • Method Details

    • setOperationMap

      public void setOperationMap(Map map)
      Sets the factory's map containing configuration properties.
      Parameters:
      map - A map containing configuration properties.
    • setDefaultOperation

      public void setDefaultOperation(Operation operation)
      Sets the default operation returned by this factory.
      Parameters:
      operation - The default operation returned by this factory.
    • getOperation

      public Operation getOperation(org.jdom2.Element originalElement, org.jdom2.Element patchElement) throws AbstractXmlMergeException
      Creates operation (action, mapper and matcher) instances corresponding to a pair of elements from the original and patch DOMs.
      Specified by:
      getOperation in interface OperationFactory
      Parameters:
      originalElement - Original element
      patchElement - Modified element
      Returns:
      The operation (action, mapper or matcher) for the given element pair
      Throws:
      AbstractXmlMergeException - If an error occurs during operation creation