Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] How to get the parameter position via IVariableBinding?

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


Back to the top