Search code examples
javaeclipseeclipse-jdt

How to recognize End Of File in eclipse?


I'm trying to recognize the End Of File or end of class in eclipse using eclipse API.

For example to recognize beginning/ending of ForLoops i do this:

public void Visit(ForStatement node){}
public void endVisit(ForStatement node){}

I tried several classes, like:

but none of them caught neither the beginning nor the ending of the class/file.

So what's the appropriate class?


Solution

  • CompilationUnit is the AST representation of a java file and TypeDeclaration represents types i.e. classes/interfaces