01: /*
02: * Author: Chris Seguin
03: *
04: * This software has been developed under the copyleft
05: * rules of the GNU General Public License. Please
06: * consult the GNU General Public License for more
07: * details about use and distribution of this software.
08: */
09: package org.acm.seguin.refactor.method;
10:
11: import org.acm.seguin.summary.MethodSummary;
12: import net.sourceforge.jrefactory.ast.ModifierHolder;
13:
14: /**
15: * Adds an abstract method to the class
16: *
17: *@author Chris Seguin
18: */
19: public class AddAbstractMethod extends AddNewMethod {
20: /**
21: * Constructor for the AddAbstractMethod object
22: *
23: *@param init The signature of the method that we are adding
24: */
25: public AddAbstractMethod(MethodSummary init) {
26: super (init);
27: }
28:
29: /**
30: * Sets up the modifiers
31: *
32: *@param source the source holder
33: *@param dest the destination holder
34: */
35: protected void copyModifiers(ModifierHolder source,
36: ModifierHolder dest) {
37: dest.copyModifiers(source);
38: dest.setAbstract(true);
39: if (dest.isPrivate()) {
40: dest.setPrivate(false);
41: dest.setProtected(true);
42: }
43: }
44:
45: /**
46: * Determines if the method is abstract
47: *
48: *@return true if the method is abstract
49: */
50: protected boolean isAbstract() {
51: return true;
52: }
53: }
|