|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> core >> [ dom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.jdt.core.dom
Class VariableDeclaration

java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.VariableDeclaration
- Direct Known Subclasses:
- SingleVariableDeclaration, VariableDeclarationFragment
- public abstract class VariableDeclaration
- extends ASTNode
Abstract base class of all AST node types that declare a single local variable.
VariableDeclaration:
SingleVariableDeclaration
VariableDeclarationFragment
- Since:
- 2.0
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.jdt.core.dom.ASTNode |
ASTNode.NodeList |
| Field Summary |
| Constructor Summary | |
(package private) |
VariableDeclaration(AST ast)
Creates a new AST node for a variable declaration owned by the given AST. |
| Method Summary | |
abstract int |
getExtraDimensions()
Returns the number of extra array dimensions over and above the explicitly-specified type. |
abstract Expression |
getInitializer()
Returns the initializer of this variable declaration, or null if there is none. |
abstract SimpleName |
getName()
Returns the name of the variable declared in this variable declaration. |
IVariableBinding |
resolveBinding()
Resolves and returns the binding for the variable declared in this variable declaration. |
abstract void |
setExtraDimensions(int dimensions)
Sets the number of extra array dimensions over and above the explicitly-specified type. |
abstract void |
setInitializer(Expression initializer)
Sets or clears the initializer of this variable declaration. |
abstract void |
setName(SimpleName variableName)
Sets the name of the variable declared in this variable declaration to the given name. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
VariableDeclaration
VariableDeclaration(AST ast)
- Creates a new AST node for a variable declaration owned by the given AST.
N.B. This constructor is package-private.
| Method Detail |
getName
public abstract SimpleName getName()
- Returns the name of the variable declared in this variable declaration.
setName
public abstract void setName(SimpleName variableName)
- Sets the name of the variable declared in this variable declaration
to the given name.
getExtraDimensions
public abstract int getExtraDimensions()
- Returns the number of extra array dimensions over and above the
explicitly-specified type.
For example,
int x[][]has a type ofintand two extra array dimensions;int[][] xhas a type ofint[][]and zero extra array dimensions. The two constructs have different ASTs, even though there are really syntactic variants of the same variable declaration.- Since:
- 2.1
setExtraDimensions
public abstract void setExtraDimensions(int dimensions)
- Sets the number of extra array dimensions over and above the
explicitly-specified type.
For example,
int x[][]has a type ofintand two extra array dimensions;int[][] xhas a type ofint[][]and zero extra array dimensions. The two constructs have different ASTs, even though there are really syntactic variants of the same variable declaration.- Since:
- 2.1
getInitializer
public abstract Expression getInitializer()
- Returns the initializer of this variable declaration, or
nullif there is none.
setInitializer
public abstract void setInitializer(Expression initializer)
- Sets or clears the initializer of this variable declaration.
resolveBinding
public IVariableBinding resolveBinding()
- Resolves and returns the binding for the variable declared in this
variable declaration.
Note that bindings are generally unavailable unless requested when the AST is being built.
|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> core >> [ dom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC