-
- 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 ExpressionTreegetBinding()Returns the binding of this declaration.ExpressionTreegetInitializer()Returns the initial value expression for this variable.booleanisConst()Is this a const declaration?booleanisLet()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 anIdentifierTreefor a binding identifier case (simple variable declaration). This is anObjectLiteralTreeor aArrayLiteralTreefor 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
-
-