org.acm.seguin.refactor.method
Class RemoveMethodVisitor

java.lang.Object
  extended by net.sourceforge.jrefactory.parser.ChildrenVisitor
      extended by org.acm.seguin.refactor.method.RemoveMethodVisitor
All Implemented Interfaces:
net.sourceforge.jrefactory.parser.JavaParserVisitor

public class RemoveMethodVisitor
extends net.sourceforge.jrefactory.parser.ChildrenVisitor

Visitor that traverses an AST and removes a specified method

Author:
Chris Seguin

Constructor Summary
RemoveMethodVisitor(MethodSummary method)
          Constructor for RemoveMethodVisitor that specifies the method to remove
 
Method Summary
protected  boolean checkDeclaration(net.sourceforge.jrefactory.ast.ASTConstructorDeclaration decl)
          Checks a single variable declaration to see if it is the one we are looking for
protected  boolean checkDeclaration(net.sourceforge.jrefactory.ast.ASTMethodDeclarator decl)
          Checks a single variable declaration to see if it is the one we are looking for
protected  boolean checkParameters(net.sourceforge.jrefactory.ast.ASTFormalParameters params)
          Description of the Method
 net.sourceforge.jrefactory.ast.SimpleNode getMethodDeclaration()
          Gets the MethodDeclaration attribute of the RemoveMethodVisitor object
protected  boolean isFound(net.sourceforge.jrefactory.ast.SimpleNode next)
          Have we found the method declaration that we are going to move?
 java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTClassBody node, java.lang.Object data)
          Visit a class body
 java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTInterfaceBody node, java.lang.Object data)
          Visit an interface body
 java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTNestedClassDeclaration node, java.lang.Object data)
          Skip nested classes
 java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTNestedInterfaceDeclaration node, java.lang.Object data)
          Skip nested interfaces
 
Methods inherited from class net.sourceforge.jrefactory.parser.ChildrenVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveMethodVisitor

public RemoveMethodVisitor(MethodSummary method)
Constructor for RemoveMethodVisitor that specifies the method to remove

Parameters:
method - the name of the method
Method Detail

getMethodDeclaration

public net.sourceforge.jrefactory.ast.SimpleNode getMethodDeclaration()
Gets the MethodDeclaration attribute of the RemoveMethodVisitor object

Returns:
The MethodDeclaration value

visit

public java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTClassBody node,
                              java.lang.Object data)
Visit a class body

Specified by:
visit in interface net.sourceforge.jrefactory.parser.JavaParserVisitor
Overrides:
visit in class net.sourceforge.jrefactory.parser.ChildrenVisitor
Parameters:
node - the class body node
data - the data for the visitor
Returns:
the method if it is found

visit

public java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTInterfaceBody node,
                              java.lang.Object data)
Visit an interface body

Specified by:
visit in interface net.sourceforge.jrefactory.parser.JavaParserVisitor
Overrides:
visit in class net.sourceforge.jrefactory.parser.ChildrenVisitor
Parameters:
node - the interface body node
data - data for the visitor
Returns:
the method that was removed

visit

public java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTNestedClassDeclaration node,
                              java.lang.Object data)
Skip nested classes

Specified by:
visit in interface net.sourceforge.jrefactory.parser.JavaParserVisitor
Overrides:
visit in class net.sourceforge.jrefactory.parser.ChildrenVisitor
Parameters:
node - the nested class
data - the data for the visitor
Returns:
the method if it is found

visit

public java.lang.Object visit(net.sourceforge.jrefactory.ast.ASTNestedInterfaceDeclaration node,
                              java.lang.Object data)
Skip nested interfaces

Specified by:
visit in interface net.sourceforge.jrefactory.parser.JavaParserVisitor
Overrides:
visit in class net.sourceforge.jrefactory.parser.ChildrenVisitor
Parameters:
node - the nested interface
data - the data for the visitor
Returns:
the method if it is found

isFound

protected boolean isFound(net.sourceforge.jrefactory.ast.SimpleNode next)
Have we found the method declaration that we are going to move?

Parameters:
next - Description of Parameter
Returns:
The Found value

checkDeclaration

protected boolean checkDeclaration(net.sourceforge.jrefactory.ast.ASTMethodDeclarator decl)
Checks a single variable declaration to see if it is the one we are looking for

Parameters:
next - the method declaration that we are checking
Returns:
true if we have found the method

checkDeclaration

protected boolean checkDeclaration(net.sourceforge.jrefactory.ast.ASTConstructorDeclaration decl)
Checks a single variable declaration to see if it is the one we are looking for

Parameters:
next - the method declaration that we are checking
Returns:
true if we have found the method

checkParameters

protected boolean checkParameters(net.sourceforge.jrefactory.ast.ASTFormalParameters params)
Description of the Method

Parameters:
params - Description of Parameter
Returns:
Description of the Returned Value