org.ceryle.util
Class ChangeMerger

java.lang.Object
  extended by org.ceryle.util.ChangeMerger
All Implemented Interfaces:
org.apache.commons.jrcs.diff.RevisionVisitor

public class ChangeMerger
extends Object
implements org.apache.commons.jrcs.diff.RevisionVisitor

This class does the housekeeping for merging changes and also makes sure that the whole change process is threadsafe by encapsulating all necessary variables. This class is derived from a helper class used in the ContextualDiffProvider supplied with JSPWiki.

To set the add and remove color styles, set the System properties, e.g.:

   System.setProperty(ChangeMerger.PROPERTY_ADD_COLOR,"#3000d0");
   System.setProperty(ChangeMerger.PROPERTY_REMOVE_COLOR,"aa0000");
 

Author:
John Volkar, Janne Jalkanen, Henning P. Schmiedehausen, Murray Altheim (breakout into separate class, colors via properties)

Field Summary
static String ADD_COLOR
          The default color to use for highlighting added text.
static String PROPERTY_ADD_COLOR
          The name of the ChangerMerger add-color property.
static String PROPERTY_REMOVE_COLOR
          The name of the ChangerMerger remove-color property.
static String REMOVE_COLOR
          The default color to use for highlighting removed text.
 
Constructor Summary
ChangeMerger(StringBuffer sb, String[] origStrings)
          Constructor for default ChangeMerger.
 
Method Summary
 void shutdown()
           
 void visit(org.apache.commons.jrcs.diff.AddDelta delta)
           
 void visit(org.apache.commons.jrcs.diff.ChangeDelta delta)
           
 void visit(org.apache.commons.jrcs.diff.DeleteDelta delta)
           
 void visit(org.apache.commons.jrcs.diff.Revision rev)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_COLOR

public static String ADD_COLOR
The default color to use for highlighting added text.


REMOVE_COLOR

public static String REMOVE_COLOR
The default color to use for highlighting removed text.


PROPERTY_ADD_COLOR

public static final String PROPERTY_ADD_COLOR
The name of the ChangerMerger add-color property.

See Also:
Constant Field Values

PROPERTY_REMOVE_COLOR

public static final String PROPERTY_REMOVE_COLOR
The name of the ChangerMerger remove-color property.

See Also:
Constant Field Values
Constructor Detail

ChangeMerger

public ChangeMerger(StringBuffer sb,
                    String[] origStrings)
Constructor for default ChangeMerger.

Method Detail

visit

public void visit(org.apache.commons.jrcs.diff.Revision rev)
Specified by:
visit in interface org.apache.commons.jrcs.diff.RevisionVisitor

visit

public void visit(org.apache.commons.jrcs.diff.AddDelta delta)
Specified by:
visit in interface org.apache.commons.jrcs.diff.RevisionVisitor

visit

public void visit(org.apache.commons.jrcs.diff.ChangeDelta delta)
Specified by:
visit in interface org.apache.commons.jrcs.diff.RevisionVisitor

visit

public void visit(org.apache.commons.jrcs.diff.DeleteDelta delta)
Specified by:
visit in interface org.apache.commons.jrcs.diff.RevisionVisitor

shutdown

public void shutdown()


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.