org.eclipse.jgit.merge
Class MergeFormatter

java.lang.Object
  extended by org.eclipse.jgit.merge.MergeFormatter

public class MergeFormatter
extends Object

A class to convert merge results into a Git conformant textual presentation


Constructor Summary
MergeFormatter()
           
 
Method Summary
 void formatMerge(OutputStream out, MergeResult<RawText> res, List<String> seqName, String charsetName)
          Formats the results of a merge of RawText objects in a Git conformant way.
 void formatMerge(OutputStream out, MergeResult res, String baseName, String oursName, String theirsName, String charsetName)
          Formats the results of a merge of exactly two RawText objects in a Git conformant way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeFormatter

public MergeFormatter()
Method Detail

formatMerge

public void formatMerge(OutputStream out,
                        MergeResult<RawText> res,
                        List<String> seqName,
                        String charsetName)
                 throws IOException
Formats the results of a merge of RawText objects in a Git conformant way. This method also assumes that the RawText objects being merged are line oriented files which use LF as delimiter. This method will also use LF to separate chunks and conflict metadata, therefore it fits only to texts that are LF-separated lines.

Parameters:
out - the outputstream where to write the textual presentation
res - the merge result which should be presented
seqName - When a conflict is reported each conflicting range will get a name. This name is following the "<<<<<<< " or ">>>>>>> " conflict markers. The names for the sequences are given in this list
charsetName - the name of the characterSet used when writing conflict metadata
Throws:
IOException

formatMerge

public void formatMerge(OutputStream out,
                        MergeResult res,
                        String baseName,
                        String oursName,
                        String theirsName,
                        String charsetName)
                 throws IOException
Formats the results of a merge of exactly two RawText objects in a Git conformant way. This convenience method accepts the names for the three sequences (base and the two merged sequences) as explicit parameters and doesn't require the caller to specify a List

Parameters:
out - the OutputStream where to write the textual presentation
res - the merge result which should be presented
baseName - the name ranges from the base should get
oursName - the name ranges from ours should get
theirsName - the name ranges from theirs should get
charsetName - the name of the characterSet used when writing conflict metadata
Throws:
IOException


Copyright © 2012. All Rights Reserved.