Package org.osjava.jardiff
Class SimpleDiffCriteria
- java.lang.Object
-
- org.osjava.jardiff.SimpleDiffCriteria
-
- All Implemented Interfaces:
DiffCriteria
public class SimpleDiffCriteria extends java.lang.Object implements DiffCriteria
A specific type of DiffCriteria which is only true for classes, methods and fields which are not synthetic, and are public or protected.- Author:
- Antony Riley
-
-
Constructor Summary
Constructors Constructor Description SimpleDiffCriteria()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
differs(ClassInfo oldInfo, ClassInfo newInfo)
Check if there is a change between two versions of a class.boolean
differs(FieldInfo oldInfo, FieldInfo newInfo)
Check if there is a change between two versions of a field.boolean
differs(MethodInfo oldInfo, MethodInfo newInfo)
Check if there is a change between two versions of a method.boolean
validClass(ClassInfo info)
Check if a class is valid.boolean
validField(FieldInfo info)
Check if a field is valid.boolean
validMethod(MethodInfo info)
Check if a method is valid.
-
-
-
Method Detail
-
validClass
public boolean validClass(ClassInfo info)
Check if a class is valid. If the class is not synthetic and is public or protected, return true.- Specified by:
validClass
in interfaceDiffCriteria
- Parameters:
info
- Info describing the class.- Returns:
- True if the class meets the criteria, false otherwise.
-
validMethod
public boolean validMethod(MethodInfo info)
Check if a method is valid. If the method is not synthetic and is public or protected, return true.- Specified by:
validMethod
in interfaceDiffCriteria
- Parameters:
info
- Info describing the method.- Returns:
- True if the method meets the criteria, false otherwise.
-
validField
public boolean validField(FieldInfo info)
Check if a field is valid. If the method is not synthetic and is public or protected, return true.- Specified by:
validField
in interfaceDiffCriteria
- Parameters:
info
- Info describing the field.- Returns:
- True if the field meets the criteria, false otherwise.
-
differs
public boolean differs(ClassInfo oldInfo, ClassInfo newInfo)
Check if there is a change between two versions of a class. Returns true if the access flags differ, or if the superclass differs or if the implemented interfaces differ.- Specified by:
differs
in interfaceDiffCriteria
- Parameters:
oldInfo
- Info about the old version of the class.newInfo
- Info about the new version of the class.- Returns:
- True if the classes differ, false otherwise.
-
differs
public boolean differs(MethodInfo oldInfo, MethodInfo newInfo)
Check if there is a change between two versions of a method. Returns true if the access flags differ, or if the thrown exceptions differ.- Specified by:
differs
in interfaceDiffCriteria
- Parameters:
oldInfo
- Info about the old version of the method.newInfo
- Info about the new version of the method.- Returns:
- True if the methods differ, false otherwise.
-
differs
public boolean differs(FieldInfo oldInfo, FieldInfo newInfo)
Check if there is a change between two versions of a field. Returns true if the access flags differ, or if the inital value of the field differs.- Specified by:
differs
in interfaceDiffCriteria
- Parameters:
oldInfo
- Info about the old version of the field.newInfo
- Info about the new version of the field.- Returns:
- True if the fields differ, false otherwise.
-
-