Package ch.galinet.xml.xmlmerge.factory
Class XPathOperationFactory
java.lang.Object
ch.galinet.xml.xmlmerge.factory.XPathOperationFactory
- All Implemented Interfaces:
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 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.voidsetDefaultOperation(Operation operation) Sets the default operation returned by this factory.voidsetOperationMap(Map map) Sets the factory's map containing configuration properties.
-
Constructor Details
-
XPathOperationFactory
public XPathOperationFactory()
-
-
Method Details
-
setOperationMap
Sets the factory's map containing configuration properties.- Parameters:
map- A map containing configuration properties.
-
setDefaultOperation
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:
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
-