- All Superinterfaces:
StatementTree
,Tree
A tree node for a variable declaration statement.
For example:
var name [ initializer ] ; var binding_pattern [ initializer ];
- Since:
- 9
-
Nested Class Summary
-
Method Summary
Methods inherited from interface org.openjdk.nashorn.api.tree.Tree
accept, getEndPosition, getKind, getStartPosition
-
Method Details
-
getBinding
ExpressionTree getBinding()Returns the binding of this declaration. This is anIdentifierTree
for a binding identifier case (simple variable declaration). This is anObjectLiteralTree
or aArrayLiteralTree
for a destructuring declaration.- Returns:
- the binding expression of this declaration
-
getInitializer
ExpressionTree getInitializer()Returns the initial value expression for this variable. This is null if no initial value for this variable.- Returns:
- the initial value expression
-
isConst
boolean isConst()Is this a const declaration?- Returns:
- true if this is a const declaration
-
isLet
boolean isLet()Is this a let declaration?- Returns:
- true if this is a let declaration
-