|
||||||||||
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
org.eclipse.jdt.core.dom.VariableDeclarationFragment
public class VariableDeclarationFragment
Variable declaration fragment AST node type, used in field declarations,
local variable declarations, and ForStatement
initializers.
It contrast to SingleVariableDeclaration
, fragments are
missing the modifiers and the type; these are located in the fragment's
parent node.
VariableDeclarationFragment: Identifier { [] } [ = Expression ]
Field Summary | |
---|---|
static SimplePropertyDescriptor |
EXTRA_DIMENSIONS_PROPERTY
The "extraDimensions" structural property of this node type. |
static ChildPropertyDescriptor |
INITIALIZER_PROPERTY
The "initializer" structural property of this node type. |
static ChildPropertyDescriptor |
NAME_PROPERTY
The "name" structural property of this node type. |
Method Summary | |
---|---|
int |
getExtraDimensions()
Returns the number of extra array dimensions this variable has over and above the type specified in the enclosing declaration. |
Expression |
getInitializer()
Returns the initializer of this variable declaration, or null if there is none. |
SimpleName |
getName()
Returns the name of the variable declared in this variable declaration. |
static java.util.List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type. |
void |
setExtraDimensions(int dimensions)
Sets the number of extra array dimensions this variable has over and above the type specified in the enclosing declaration. |
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.eclipse.jdt.core.dom.VariableDeclaration |
---|
getExtraDimensionsProperty, getInitializerProperty, getNameProperty, resolveBinding |
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 |
Field Detail |
---|
public static final ChildPropertyDescriptor NAME_PROPERTY
public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY
public static final ChildPropertyDescriptor INITIALIZER_PROPERTY
Method Detail |
---|
public static java.util.List propertyDescriptors(int apiLevel)
apiLevel
- the API level; one of the
AST.JLS*
constants
StructuralPropertyDescriptor
)public SimpleName getName()
VariableDeclaration
getName
in class VariableDeclaration
public void setName(SimpleName variableName)
VariableDeclaration
setName
in class VariableDeclaration
variableName
- the new variable namepublic int getExtraDimensions()
For example, in the AST for int[] i, j[], k[][]
the
variable declaration fragments for the variables i
,
j
, and k
, have 0, 1, and 2 extra array
dimensions, respectively.
getExtraDimensions
in class VariableDeclaration
public void setExtraDimensions(int dimensions)
For example, in the AST for int[] i, j[], k[][]
the
variable declaration fragments for the variables i
,
j
, and k
, have 0, 1, and 2 extra array
dimensions, respectively.
setExtraDimensions
in class VariableDeclaration
dimensions
- the given dimensionspublic Expression getInitializer()
VariableDeclaration
null
if there is none.
getInitializer
in class VariableDeclaration
null
if
there is nonepublic void setInitializer(Expression initializer)
VariableDeclaration
setInitializer
in class VariableDeclaration
initializer
- the initializer expression node, or null
if there is none
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |