|
Eclipse JDT 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jdt.core.dom.ASTNode | +--org.eclipse.jdt.core.dom.VariableDeclaration
Abstract base class of all AST node types that declare a single local variable.
VariableDeclaration: SingleVariableDeclaration VariableDeclarationFragment
SingleVariableDeclaration
,
VariableDeclarationFragment
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 org.eclipse.jdt.core.dom.ASTNode |
accept, copySubtree, copySubtrees, equals, getAST, getFlags, getLength, getNodeType, getParent, getProperty, getRoot, getStartPosition, properties, setFlags, setProperty, setSourceRange, subtreeBytes, subtreeMatch, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public abstract SimpleName getName()
public abstract void setName(SimpleName variableName)
variableName
- the new variable nameIllegalArgumentException
- if:
public abstract int getExtraDimensions()
For example, int x[][]
has a type of
int
and two extra array dimensions;
int[][] x
has a type of int[][]
and zero extra array dimensions. The two constructs have different
ASTs, even though there are really syntactic variants of the same
variable declaration.
public abstract void setExtraDimensions(int dimensions)
For example, int x[][]
has a type of
int
and two extra array dimensions;
int[][] x
has a type of int[][]
and zero extra array dimensions. The two constructs have different
ASTs, even though there are really syntactic variants of the same
variable declaration.
dimensions
- the number of array dimensionsIllegalArgumentException
- if the number of dimensions is
negativepublic abstract Expression getInitializer()
null
if there is none.null
if
there is nonepublic abstract void setInitializer(Expression initializer)
initializer
- the initializer expression node, or null
if there is noneIllegalArgumentException
- if:
public IVariableBinding resolveBinding()
Note that bindings are generally unavailable unless requested when the AST is being built.
null
if the binding cannot be
resolved
|
Eclipse JDT 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |