org.osjava.jardiff
Interface DiffHandler

All Known Implementing Classes:
AbstractDiffHandler, DOMDiffHandler, StreamDiffHandler

public interface DiffHandler

An interface for classes which wish to receive information about differences in class files between two different jar file version to implement.

Author:
Antony Riley

Method Summary
 void classAdded(ClassInfo classinfo)
          Notification that a class was added.
 void classChanged(ClassInfo oldClassinfo, ClassInfo newClassinfo)
          The current class has changed.
 void classRemoved(ClassInfo classinfo)
          Notification that a class was removed.
 void contains(ClassInfo info)
          Add a contained class.
 void endAdded()
          End of list of removed classes.
 void endChanged()
          End of class changes.
 void endClassChanged()
          End of changes for the current class.
 void endDiff()
          End of the diff.
 void endNewContents()
          End the list of new contents.
 void endOldContents()
          End the list of old contents.
 void endRemoved()
          End of list of removed classes.
 void fieldAdded(FieldInfo fieldinfo)
          The field was added for the current class that has changed.
 void fieldChanged(FieldInfo oldFieldinfo, FieldInfo newFieldinfo)
          A field on the current class has changed.
 void fieldRemoved(FieldInfo fieldinfo)
          The field was removed for the current class that has changed.
 void methodAdded(MethodInfo methodinfo)
          The method was added for the current class that has changed.
 void methodChanged(MethodInfo oldMethodInfo, MethodInfo newMethodInfo)
          A method on the current class has changed.
 void methodRemoved(MethodInfo methodinfo)
          The method was removed for the current class that has changed.
 void startAdded()
          Start of list of added classes.
 void startChanged()
          Start list of changed classes.
 void startClassChanged(String string)
          Start information about class changes for the classname passed.
 void startDiff(String a, String b)
          Start a diff between two versions, where string a is the old version and string b is the new version.
 void startNewContents()
          Start the list of new contents.
 void startOldContents()
          Start the list of old contents.
 void startRemoved()
          Start the list of removed classes.
 

Method Detail

startDiff

public void startDiff(String a,
                      String b)
               throws DiffException
Start a diff between two versions, where string a is the old version and string b is the new version.

Parameters:
a - the name of the old version
b - the name of the new version
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

startOldContents

public void startOldContents()
                      throws DiffException
Start the list of old contents.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

startNewContents

public void startNewContents()
                      throws DiffException
Start the list of new contents.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

contains

public void contains(ClassInfo info)
              throws DiffException
Add a contained class.

Parameters:
info - information about a class
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endOldContents

public void endOldContents()
                    throws DiffException
End the list of old contents.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endNewContents

public void endNewContents()
                    throws DiffException
End the list of new contents.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

startRemoved

public void startRemoved()
                  throws DiffException
Start the list of removed classes.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

classRemoved

public void classRemoved(ClassInfo classinfo)
                  throws DiffException
Notification that a class was removed.

Parameters:
classinfo - information about the class that has been removed.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endRemoved

public void endRemoved()
                throws DiffException
End of list of removed classes.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

startAdded

public void startAdded()
                throws DiffException
Start of list of added classes.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

classAdded

public void classAdded(ClassInfo classinfo)
                throws DiffException
Notification that a class was added.

Parameters:
classinfo - information about the class that has been removed.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endAdded

public void endAdded()
              throws DiffException
End of list of removed classes.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

startChanged

public void startChanged()
                  throws DiffException
Start list of changed classes.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

startClassChanged

public void startClassChanged(String string)
                       throws DiffException
Start information about class changes for the classname passed.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

fieldRemoved

public void fieldRemoved(FieldInfo fieldinfo)
                  throws DiffException
The field was removed for the current class that has changed.

Parameters:
fieldinfo - Information about the field removed.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

methodRemoved

public void methodRemoved(MethodInfo methodinfo)
                   throws DiffException
The method was removed for the current class that has changed.

Parameters:
methodinfo - Information about the method removed.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

fieldAdded

public void fieldAdded(FieldInfo fieldinfo)
                throws DiffException
The field was added for the current class that has changed.

Parameters:
fieldinfo - Information about the field added.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

methodAdded

public void methodAdded(MethodInfo methodinfo)
                 throws DiffException
The method was added for the current class that has changed.

Parameters:
methodinfo - Information about the method added.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

classChanged

public void classChanged(ClassInfo oldClassinfo,
                         ClassInfo newClassinfo)
                  throws DiffException
The current class has changed. This is called when a class's interfaces or superclass or access flags have changed.

Parameters:
oldClassinfo - Information about the old class.
newClassinfo - Information about the new class.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

fieldChanged

public void fieldChanged(FieldInfo oldFieldinfo,
                         FieldInfo newFieldinfo)
                  throws DiffException
A field on the current class has changed.

Parameters:
oldFieldinfo - Information about the old field.
newFieldinfo - Information about the new field.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

methodChanged

public void methodChanged(MethodInfo oldMethodInfo,
                          MethodInfo newMethodInfo)
                   throws DiffException
A method on the current class has changed.

Parameters:
oldMethodInfo - Information about the old method.
newMethodInfo - Information about the new method.
Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endClassChanged

public void endClassChanged()
                     throws DiffException
End of changes for the current class.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endChanged

public void endChanged()
                throws DiffException
End of class changes.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException

endDiff

public void endDiff()
             throws DiffException
End of the diff.

Throws:
DiffException - when there is an underlying exception, e.g. writing to a file caused an IOException


Copyright © 2005-2006 OSJava. All Rights Reserved.