|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IVariableBinding
A variable binding represents either a field of a class or interface, or a local variable declaration (including formal parameters, local variables, and exception variables).
ITypeBinding.getDeclaredFields()
Field Summary |
---|
Fields inherited from interface org.eclipse.jdt.core.dom.IBinding |
---|
ANNOTATION, MEMBER_VALUE_PAIR, METHOD, PACKAGE, TYPE, VARIABLE |
Method Summary | |
---|---|
java.lang.Object |
getConstantValue()
Returns this binding's constant value if it has one. |
ITypeBinding |
getDeclaringClass()
Returns the type binding representing the class or interface that declares this field. |
IMethodBinding |
getDeclaringMethod()
Returns the method binding representing the method containing the scope in which this local variable is declared. |
java.lang.String |
getName()
Returns the name of the field or local variable declared in this binding. |
ITypeBinding |
getType()
Returns the binding for the type of this field or local variable. |
IVariableBinding |
getVariableDeclaration()
Returns the binding for the variable declaration corresponding to this variable binding. |
int |
getVariableId()
Returns a small integer variable id for this variable binding. |
boolean |
isEnumConstant()
Returns whether this binding is for an enum constant. |
boolean |
isField()
Returns whether this binding is for a field. |
boolean |
isParameter()
Returns whether this binding corresponds to a parameter. |
Methods inherited from interface org.eclipse.jdt.core.dom.IBinding |
---|
equals, getAnnotations, getJavaElement, getKey, getKind, getModifiers, isDeprecated, isEqualTo, isRecovered, isSynthetic, toString |
Method Detail |
---|
boolean isField()
true
for constants,
including enum constants. This method returns false
for local variables.
true
if this is the binding for a field,
and false
otherwiseboolean isEnumConstant()
false
for local variables
and for fields other than enum constants.
true
if this is the binding for an enum constant,
and false
otherwiseboolean isParameter()
true
if this is the binding for a parameter,
and false
otherwisejava.lang.String getName()
getName
in interface IBinding
ITypeBinding getDeclaringClass()
The declaring class of a field is the class or interface of which it is a member. Local variables have no declaring class. The field length of an array type has no declaring class.
null
if noneITypeBinding getType()
int getVariableId()
Local variables inside methods: Local variables (and parameters) declared within a single method are assigned ascending ids in normal code reading order; var1.getVariableId()<var2.getVariableId() means that var1 is declared before var2.
Local variables outside methods: Local variables declared in a type's static initializers (or initializer expressions of static fields) are assigned ascending ids in normal code reading order. Local variables declared in a type's instance initializers (or initializer expressions of non-static fields) are assigned ascending ids in normal code reading order. These ids are useful when checking definite assignment for static initializers (JLS 16.7) and instance initializers (JLS 16.8), respectively.
Fields: Fields declared as members of a type are assigned ascending ids in normal code reading order; field1.getVariableId()<field2.getVariableId() means that field1 is declared before field2.
java.lang.Object getConstantValue()
Integer
). If the type of the value is
String
, the result is the string itself. If the variable has
no compile-time computed value, the result is null
.
(Note: compile-time constant expressions cannot denote null
;
JLS2 15.28.). The result is always null
for enum constants.
null
if noneIMethodBinding getDeclaringMethod()
The declaring method of a method formal parameter is the method itself.
For a local variable declared somewhere within the body of a method,
the declaring method is the enclosing method. When local or anonymous
classes are involved, the declaring method is the innermost such method.
There is no declaring method for a field, or for a local variable
declared in a static or instance initializer; this method returns
null
in those cases.
null
if noneIVariableBinding getVariableDeclaration()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |