|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.VariableDeclaration
public abstract class VariableDeclaration
Abstract base class of all AST node types that declare a single local variable.
VariableDeclaration: SingleVariableDeclaration VariableDeclarationFragment
SingleVariableDeclaration
,
VariableDeclarationFragment
Field Summary |
---|
Method Summary | |
---|---|
abstract int |
getExtraDimensions()
Returns the number of extra array dimensions over and above the explicitly-specified type. |
SimplePropertyDescriptor |
getExtraDimensionsProperty()
Returns structural property descriptor for the "extraDimensions" property of this node. |
abstract Expression |
getInitializer()
Returns the initializer of this variable declaration, or null if there is none. |
ChildPropertyDescriptor |
getInitializerProperty()
Returns structural property descriptor for the "initializer" property of this node. |
abstract SimpleName |
getName()
Returns the name of the variable declared in this variable declaration. |
ChildPropertyDescriptor |
getNameProperty()
Returns structural property descriptor for the "name" property of this node. |
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, delete, equals, getAST, getFlags, getLength, getLocationInParent, getNodeType, getParent, getProperty, getRoot, getStartPosition, getStructuralProperty, hashCode, nodeClassForType, properties, setFlags, setProperty, setSourceRange, setStructuralProperty, structuralPropertiesForType, subtreeBytes, subtreeMatch, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public final SimplePropertyDescriptor getExtraDimensionsProperty()
public final ChildPropertyDescriptor getInitializerProperty()
public final ChildPropertyDescriptor getNameProperty()
public abstract SimpleName getName()
public abstract void setName(SimpleName variableName)
variableName
- the new variable name
java.lang.IllegalArgumentException
- 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 dimensions
java.lang.IllegalArgumentException
- 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 none
java.lang.IllegalArgumentException
- 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |