Introduction
This sample is a basic demonstration of how to use XML Merge's Java API to run some simple merge operations with hard-coded file paths.
Implementation
The sample is implemented in the main
method of a single Java class, SimpleRunner.java, and the approach taken is as follows:
Create File objects for sample inputs.
Instantiate the merge object using either ConcurrentMerge or SequentialMerge;
Set the ancestor file (Only for ConcurrentMerge) with: ConcurrentMerge.setAncestor;
Add the demo input versions by using one of the following:
ConcurrentMerge.addVersion
SequentialMerge.addVersion
Call one of the following methods to produce a DeltaV2 representation of the merge.
ConcurrentMerge.extractAll
SequentialMerge.extractAll
Additionally, the ThreeWayMerge class can be used with one of its merge
methods to allow merge operations to be performed with a single method call. This class also allows the approach shown above but we only demonstrate the simpler method calls in the sample code.
Running
To run this sample, all the files you need together with instructions are available on Bitbucket