Created
April 19, 2014 23:15
-
-
Save samueltcsantos/11100456 to your computer and use it in GitHub Desktop.
Implementando um visitor para localizar os métodos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jdt.info.handlers; | |
import java.util.List; | |
import java.util.ArrayList; | |
import org.eclipse.jdt.core.dom.ASTVisitor; | |
import org.eclipse.jdt.core.dom.MethodDeclaration; | |
/** | |
* Implementing a custom method visitor. | |
* | |
* @author Samuel T. C. Santos | |
* | |
*/ | |
public class MethodVisitor extends ASTVisitor { | |
private List<MethodDeclaration> methodList = new ArrayList<MethodDeclaration>(); | |
@Override | |
public boolean visit(MethodDeclaration node) { | |
methodList.add(node); | |
return super.visit(node); | |
} | |
/** | |
* Get all method visited by MethodVisitor. | |
* | |
* @return | |
*/ | |
public List<MethodDeclaration> getMethods(){ | |
return methodList; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment