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.
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:
- Add the demo input versions by using one of the following:
- Call one of the following methods to produce a DeltaV2 representation of the merge.
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.
To run this sample, all the files you need together with instructions are available on Bitbucket