using ASTParesr to get block of Expression [message #1735315] |
Fri, 17 June 2016 06:46  |
Eclipse User |
|
|
|
hi
i this example :
Thread thread = new Thread("New Thread") {
public void run(){
System.out.println("run by: " + getName());
}
};
thread.start();
System.out.println(thread.getName());
i need to get all method in block
new Thread("New Thread") {
public void run(){
System.out.println("run by: " + getName());
}
};
in my example all method in block of new Thread in run();
i can to get new Thread("New Thread") by Expression using the following code :
Expression expression = node.getExpression();
if (expression != null) {
System.out.println("Expr: " + expression.toString());
ITypeBinding typeBinding = expression.resolveTypeBinding();
if (typeBinding != null) {
System.out.println("Type: " + typeBinding.getName());
}
}
how can to get the block of new Thread("New Thread") { }
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03994 seconds