Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 
 package org.eclipse.jdt.core.dom;

Abstract base class of all AST node types that declare a single local variable.

 VariableDeclaration:
    SingleVariableDeclaration
    VariableDeclarationFragment
 

 
 public abstract class VariableDeclaration extends ASTNode {

Returns structural property descriptor for the "extraDimensions" property of this node (type: java.lang.Integer).

Returns:
the property descriptor
Since:
3.1
 
Returns structural property descriptor for the "extraDimensions" property of this node (type: java.lang.Integer).

Returns:
the property descriptor
Since:
3.1
 
 	}

Returns structural property descriptor for the "initializer" property of this node (child type: Expression).

Returns:
the property descriptor
Since:
3.1
 
Returns structural property descriptor for the "initializer" property of this node (child type: Expression).

Returns:
the property descriptor
Since:
3.1
 
 	}

Returns structural property descriptor for the "name" property of this node (child type: SimpleName).

Returns:
the property descriptor
Since:
3.1
 
Returns structural property descriptor for the "name" property of this node (child type: SimpleName).

Returns:
the property descriptor
Since:
3.1
 
 	}

Creates a new AST node for a variable declaration owned by the given AST.

N.B. This constructor is package-private.

Parameters:
ast the AST that is to own this node
 
		super(ast);
	}

Returns the name of the variable declared in this variable declaration.

Returns:
the variable name node
	public abstract SimpleName getName();

Sets the name of the variable declared in this variable declaration to the given name.

Parameters:
variableName the new variable name
Throws:
java.lang.IllegalArgumentException if:
  • the node belongs to a different AST
  • the node already has a parent
	public abstract void setName(SimpleName variableName);

Returns the number of extra array dimensions over and above the explicitly-specified type.

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.

Returns:
the number of extra array dimensions
Since:
2.1
	public abstract int getExtraDimensions();

Sets the number of extra array dimensions over and above the explicitly-specified type.

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.

Parameters:
dimensions the number of array dimensions
Throws:
java.lang.IllegalArgumentException if the number of dimensions is negative
Since:
2.1
	public abstract void setExtraDimensions(int dimensions);

Returns the initializer of this variable declaration, or null if there is none.

Returns:
the initializer expression node, or null if there is none
	public abstract Expression getInitializer();

Sets or clears the initializer of this variable declaration.

Parameters:
initializer the initializer expression node, or null if there is none
Throws:
java.lang.IllegalArgumentException if:
  • the node belongs to a different AST
  • the node already has a parent
  • a cycle in would be created
	public abstract void setInitializer(Expression initializer);

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.

Returns:
the binding, or null if the binding cannot be resolved
	}
New to GrepCode? Check out our FAQ X