|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.aspectj.org.eclipse.jdt.core.dom.ASTNode
org.aspectj.org.eclipse.jdt.core.dom.VariableDeclaration
public abstract class VariableDeclaration
Abstract base class of all AST node types that declare a single variable.
VariableDeclaration:
SingleVariableDeclaration
VariableDeclarationFragment
SingleVariableDeclaration,
VariableDeclarationFragment| Field Summary |
|---|
| Method Summary | |
|---|---|
java.util.List |
extraDimensions()
Returns the live ordered list of extra dimensions with optional annotations (added in JLS8 API). |
int |
getExtraDimensions()
Returns the number of extra array dimensions over and above the explicitly-specified type. |
ChildListPropertyDescriptor |
getExtraDimensions2Property()
Returns the structural property descriptor for the "extraDimensions" property of this node (element type: Dimension) (added in JLS8 API). |
SimplePropertyDescriptor |
getExtraDimensionsProperty()
Deprecated. In JLS8 and later, use getExtraDimensions2Property() instead. |
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 (child type: Expression). |
SimpleName |
getName()
Returns the name of the variable declared in this variable declaration. |
ChildPropertyDescriptor |
getNameProperty()
Returns the structural property descriptor for the "name" property of this node (child type: SimpleName). |
IVariableBinding |
resolveBinding()
Resolves and returns the binding for the variable declared in this variable declaration. |
void |
setExtraDimensions(int dimensions)
Deprecated. In the JLS8 API, this method is replaced by extraDimensions() which contains a list of Dimension nodes. |
void |
setInitializer(Expression initializer)
Sets or clears the initializer of this variable declaration. |
void |
setName(SimpleName variableName)
Sets the name of the variable declared in this variable declaration to the given name. |
| Methods inherited from class org.aspectj.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 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public final ChildPropertyDescriptor getNameProperty()
SimpleName).
public final SimplePropertyDescriptor getExtraDimensionsProperty()
getExtraDimensions2Property() instead.
Integer) (below JLS8 only).
public final ChildListPropertyDescriptor getExtraDimensions2Property()
Dimension) (added in JLS8 API).
public final ChildPropertyDescriptor getInitializerProperty()
Expression).
public SimpleName getName()
public void setName(SimpleName variableName)
variableName - the new variable name
java.lang.IllegalArgumentException - if:
public 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.
In the JLS8 API, this method is a convenience method that
counts extraDimensions().
public void setExtraDimensions(int dimensions)
extraDimensions() which contains a list of Dimension nodes.
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
negative
java.lang.UnsupportedOperationException - if this operation is used in
a JLS8 or later ASTpublic java.util.List extraDimensions()
Dimension)
java.lang.UnsupportedOperationException - if this operation is used below JLS8public Expression getInitializer()
null if there is none.
null if
there is nonepublic 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 | ||||||||