Package ch.galinet.xml.xmlmerge.factory
Class DiffOperationFactory
java.lang.Object
ch.galinet.xml.xmlmerge.factory.DiffOperationFactory
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOperation(org.jdom2.Element originalElement, org.jdom2.Element patchElement) Creates operation (action, mapper and matcher) instances corresponding to a pair of elements from the original and patch DOMs.voidsetInBothOperationFactory(OperationFactory inBothOperationFactory) Sets the operation factory this factory delegates to if the original and patch elements exist.voidsetOnlyInOriginalOperationFactory(OperationFactory onlyInOriginalOperationFactory) Sets the operation factory this factory delegates to if only the original element exists.voidsetOnlyInPatchOperationFactory(OperationFactory onlyInPatchOperationFactory) Sets the operation factory this factory delegates to if only the patch element exists.
-
Constructor Details
-
DiffOperationFactory
public DiffOperationFactory()
-
-
Method Details
-
setInBothOperationFactory
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
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
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:
getOperationin interfaceOperationFactory- Parameters:
originalElement- Original elementpatchElement- Modified element- Returns:
- The operation (action, mapper or matcher) for the given element pair
- Throws:
AbstractXmlMergeException- If an error occurs during operation creation
-