-
- All Superinterfaces:
StatementTree
,Tree
public interface VariableTree extends StatementTree
A tree node for a variable declaration statement. For example:var name [ initializer ] ; var binding_pattern [ initializer ];
- Since:
- 9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExpressionTree
getBinding()
Returns the binding of this declaration.ExpressionTree
getInitializer()
Returns the initial value expression for this variable.boolean
isConst()
Is this a const declaration?boolean
isLet()
Is this a let declaration?-
Methods inherited from interface jdk.nashorn.api.tree.Tree
accept, getEndPosition, getKind, getStartPosition
-
-
-
-
Method Detail
-
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
-
-