Java API Sample

 Table of Contents

1. Introduction

This sample is a basic demonstration of how to use DITA Merge's Java API to run some DITA Merge operations with hard-coded file paths.

2. Implementation

The sample is implemented in the main method of a single Java class, SimpleRunner.java, and the approach taken is as follows:

  1. Create File objects for sample inputs.
  2. Instantiate the ConcurrentMerge object using the constructor;
  3. Set the ancestor file with setAncestor;
  4. Add the demo input versions with addVersion;
  5. Call extractAll to get hold of the DeltaV2 representation of the merge.

Additionally use is made of the ThreeWayMerge class and one of its merge methods which allows merge operations to be performed using a single method call. This class also allows the approach show above but we only demonstrate the simpler method calls in the sample code.

3. Running

The files and instructions for this sample are available on Bitbucket.

#content .code