• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package jdiff;
2 
3 import java.util.*;
4 import com.sun.javadoc.*;
5 
6 /**
7  * The changes between two class constructor, method or field members.
8  *
9  * See the file LICENSE.txt for copyright details.
10  * @author Matthew Doar, mdoar@pobox.com
11  */
12 class MemberDiff {
13 
14     /** The name of the member. */
15     public String name_;
16 
17     /**
18      * The old member type. For methods, this is the return type.
19      */
20     public String oldType_ = null;
21     /**
22      * The new member type. For methods, this is the return type.
23      */
24     public String newType_ = null;
25 
26     /** The old signature. Null except for methods. */
27     public String oldSignature_ = null;
28     /** The new signature. Null except for methods. */
29     public String newSignature_ = null;
30 
31     /**
32      * The old list of exceptions. Null except for methods and constructors.
33      */
34     public String oldExceptions_ = null;
35     /**
36      * The new list of exceptions. Null except for methods and constructors.
37      */
38     public String newExceptions_ = null;
39 
40     /**
41      * A string describing the changes in documentation.
42      */
43     public String documentationChange_ = null;
44 
45     /**
46      * A string describing the changes in modifiers.
47      * Changes can be in whether this is abstract, static, final, and in
48      * its visibility.
49      * Null if no change.
50      */
51     public String modifiersChange_ = null;
52 
53     /**
54      * The class name where the new member is defined.
55      * Null if no change in inheritance.
56      */
57     public String inheritedFrom_ = null;
58 
59     /** Default constructor. */
MemberDiff(String name)60     public MemberDiff(String name) {
61         name_ = name;
62     }
63 
64     /** Add a change in the modifiers. */
addModifiersChange(String commonModifierChanges)65     public void addModifiersChange(String commonModifierChanges) {
66         if (commonModifierChanges != null) {
67             if (modifiersChange_ == null)
68                 modifiersChange_ = commonModifierChanges;
69             else
70                 modifiersChange_ += " " + commonModifierChanges;
71         }
72     }
73 }
74