[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jdt-core-dev] How to get the parameter position viaIVariableBinding?
|
Hi Sven,
The "pos" in the toString() refers to the position of the parameter in the generated code which could be different from the source position - So are you interested in the position of the parameter in the source, or in the generated code?
Regards,
Manoj
Sven Strohschein ---09/27/2015 04:49:27 PM---Hi, I'm parsing source code via JDT and need to get the parameter position
From: Sven Strohschein <novanic@xxxxxx>
To: jdt-core-dev@xxxxxxxxxxx
Date: 09/27/2015 04:49 PM
Subject: [jdt-core-dev] How to get the parameter position via IVariableBinding?
Sent by: jdt-core-dev-bounces@xxxxxxxxxxx
Hi,
I'm parsing source code via JDT and need to get the parameter position
from a parameter usage. I have resolved the parameter usage to an
IVariableBinding, but how can I get the parameter position within the
method signature? I know that the information is existing, because the
position is printed via the toString() method, for example
"java.lang.String aParameter[pos: 1][id:0][pc: 0-1]" (via
VariableBinding#toString() -> VariableBinding#binding (private member
variable) -> LocalVariableBinding#resolvedPosition (public member
variable)).
Have I to parse the information from the toString() result or accessing
the private member variable "VariableBinding#binding" with some casts
and reflection or is there an official way to get this information? :-)
Thanks in advance! :-)
Regards,
Sven
_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-core-dev