|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acm.seguin.refactor.TransformAST
org.acm.seguin.refactor.method.AddConstructor
public class AddConstructor
A series of transformations taht adds a new constructor to a class. The constructor invokes the super classes's constructor. This object shares a lot in common with the AddNewMethod class, and combining these two objects can be considered for future refactorings.
Field Summary | |
---|---|
protected MethodSummary |
methodSummary
The method we are updating |
Constructor Summary | |
---|---|
AddConstructor(MethodSummary init,
java.lang.String name)
Constructor for the AddConstructor object |
Method Summary | |
---|---|
protected void |
addBody(net.sourceforge.jrefactory.ast.SimpleNode methodDecl,
int index)
Adds the body of the method |
protected int |
addExceptions(net.sourceforge.jrefactory.ast.SimpleNode methodDecl,
int index)
Adds the exceptions to the node |
protected void |
addReturn(net.sourceforge.jrefactory.ast.SimpleNode methodDecl,
int index)
Adds the return to the method declaration |
protected net.sourceforge.jrefactory.ast.ASTNameList |
createExceptions(java.util.Iterator iter)
Creates the exceptions |
protected net.sourceforge.jrefactory.ast.ASTFormalParameters |
createParameters()
Creates the parameters |
protected boolean |
isAbstract()
Determines if the method is abstract |
void |
update(net.sourceforge.jrefactory.ast.SimpleNode root)
Update the syntax tree |
Methods inherited from class org.acm.seguin.refactor.TransformAST |
---|
copyModifiers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MethodSummary methodSummary
Constructor Detail |
---|
public AddConstructor(MethodSummary init, java.lang.String name)
init
- the method summary to addMethod Detail |
---|
public void update(net.sourceforge.jrefactory.ast.SimpleNode root)
update
in class TransformAST
root
- the root of the syntax treeprotected boolean isAbstract()
protected void addReturn(net.sourceforge.jrefactory.ast.SimpleNode methodDecl, int index)
methodDecl
- The feature to be added to the Return attributeindex
- The feature to be added to the Return attributeprotected net.sourceforge.jrefactory.ast.ASTFormalParameters createParameters()
protected net.sourceforge.jrefactory.ast.ASTNameList createExceptions(java.util.Iterator iter)
iter
- Description of Parameter
protected int addExceptions(net.sourceforge.jrefactory.ast.SimpleNode methodDecl, int index)
methodDecl
- The feature to be added to the Exceptions attributeindex
- The feature to be added to the Exceptions attribute
protected void addBody(net.sourceforge.jrefactory.ast.SimpleNode methodDecl, int index)
methodDecl
- The feature to be added to the Body attributeindex
- The feature to be added to the Body attribute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |