Class DiffOperationFactory

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

public class DiffOperationFactory extends Object implements OperationFactory
An operation factory delegating to other operation factories according to the existence of the original and patch element.
Author:
Laurent Bovet (LBO), Alex Mathey (AMA)
  • Constructor Details

    • DiffOperationFactory

      public DiffOperationFactory()
  • Method Details

    • setInBothOperationFactory

      public void setInBothOperationFactory(OperationFactory inBothOperationFactory)
      Sets the operation factory this factory delegates to if the original and patch elements exist.
      Parameters:
      inBothOperationFactory - the operation factory this factory delegates to if the original and patch elements exist.
    • setOnlyInOriginalOperationFactory

      public void setOnlyInOriginalOperationFactory(OperationFactory onlyInOriginalOperationFactory)
      Sets the operation factory this factory delegates to if only the original element exists.
      Parameters:
      onlyInOriginalOperationFactory - factory this factory delegates to if only the original element exists
    • setOnlyInPatchOperationFactory

      public void setOnlyInPatchOperationFactory(OperationFactory onlyInPatchOperationFactory)
      Sets the operation factory this factory delegates to if only the patch element exists.
      Parameters:
      onlyInPatchOperationFactory - factory this factory delegates to if only the patch element exists
    • 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