John Assymptoth
John Assymptoth

Reputation: 8507

How to know if a Variable Binding represents a local variable, in Eclipse JDT?

I've noticed eclipse.jdt.core.dom variable bindings (IVariableBinding) offer boolean methods to check if they are representing a field, Enum constant or parameter ( isEnumConstant(), isField() and isParameter() ).

How can I know if it represents a local variable? Is it safe to assume that if a IVariableBinding is not one of the former three it will ALWAYS be a local variable?

Upvotes: 1

Views: 408

Answers (1)

John Assymptoth
John Assymptoth

Reputation: 8507

Answer from the Eclipse Forums (thanks to Deepak Azad): YES, it will always be a local variable, as I suspected.

Upvotes: 3

Related Questions