|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The JotVariable
interface represents a variable. A variable
could be either a local variable or a member field. Each
variable is contained within a variable declaration. A variable declaration
may contain more than one variable. For example, the declaration
int x, y;
contains two variables.
A variable provides read-only access to its modifiers and its type; as these
are derived from its owning variable declaration, write access is through the
declaration. However, the array dimensions of the variable's type (if any) can be
changed directly, although the dimension cannot be reduced below those provided
by the declaration. For example, in the declaration int[] x;
, the
type of x
could be changed to int[][]
(making
the declaration int[] x[];
, but not to int
.
JotVariableDeclaration
,
JotLocalVariable
,
JotField
Method Summary | |
JotField |
getAsField()
Retrieves this variable as a field. |
JotLocalVariable |
getAsLocalVariable()
Retrieves this variable as a local variable. |
JotExpression |
getInitializer()
Retrieves the initialization expression of this variable. |
int |
getModifiers()
Retrieves the Java modifiers declared for this variable, encoded as a mask. |
JotVariableDeclaration |
getOwningDeclaration()
Retrieves the variable declaration that owns this variable. |
JotType |
getType()
Retrieves the type of this variable. |
void |
setArrayDimensions(int newDims)
Sets the array dimensions of this variable. |
void |
setInitializer(java.lang.String init)
Sets the initialization expression of this variable. |
Methods inherited from interface oracle.jdeveloper.jot.JotNameable |
getName, setName |
Methods inherited from interface oracle.jdeveloper.jot.JotElement |
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent |
Method Detail |
public JotType getType()
public int getModifiers()
java.lang.reflect.Modifier
; use the methods provided by
Modifier
to decode the value (for example,
Modifier.isPublic()
).
Modifier
public void setArrayDimensions(int newDims)
newDims
- the new array dimensions of this variable.public JotVariableDeclaration getOwningDeclaration()
public JotExpression getInitializer()
JotExpression
representing the
intialization expression of this variable.public void setInitializer(java.lang.String init) throws JotException
init
- the new initialization expression.
JotException
- if the initializer cannot be changed.public JotField getAsField()
JotField
instance if it
represents a field, or null
if it does not.public JotLocalVariable getAsLocalVariable()
JotLocalVariable
instance if it
represents a local variable, or null
if it does not.
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.