Extension SDK 9.0.5

oracle.jdeveloper.jot
Interface JotForInitializer

All Superinterfaces:
JotCodeElement, JotElement

public interface JotForInitializer
extends JotCodeElement

A JotForInitialzer represents the initialization clause of a for statement. An initialization clause can contain either a variable declaration (with one or more variables) or a list of statement expressions. The initializer can also be empty.

Since:
9.0.2

Method Summary
 JotStatementExpression addExpression(JotStatementExpression marker, boolean before, java.lang.String exp)
          Adds a new expression to this initialization clause.
 JotStatementExpression[] getExpressions()
          Retrieves the list of statement expressions contained in this initialization clause.
 JotVariableDeclaration getVariableDeclaration()
          Retrieves the variable declaration contained in this initialization clause, or null if this clause does not contain a variable declaration.
 void removeExpression(JotStatementExpression exp)
          Removes an existing expression from this initialization clause.
 void setInitializationText(java.lang.String text)
          Sets the text of this initialization clause.
 JotVariableDeclaration setVariableDeclaration(java.lang.String vType, java.lang.String vName)
          Sets the contents of this initialization clause to a variable declaration.
 
Methods inherited from interface oracle.jdeveloper.jot.JotCodeElement
addPrecedingComment, childrenContainErrors, delete, getContainingJotFile, getLeftWhitespace, getLength, getRightWhitespace, isInError, isSource, setLeftWhitespace, setRightWhitespace
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getChildren, getContainedElements, getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Method Detail

getVariableDeclaration

public JotVariableDeclaration getVariableDeclaration()
                                              throws JotInvalidElementException
Retrieves the variable declaration contained in this initialization clause, or null if this clause does not contain a variable declaration.

Throws:
JotInvalidElementException

setVariableDeclaration

public JotVariableDeclaration setVariableDeclaration(java.lang.String vType,
                                                     java.lang.String vName)
                                              throws JotInvalidElementException
Sets the contents of this initialization clause to a variable declaration. Any existing contents are removed.

Parameters:
vType - the type of the variable declaration
vName - the name of the first variable of the declaration.
Throws:
JotInvalidElementException

getExpressions

public JotStatementExpression[] getExpressions()
                                        throws JotInvalidElementException
Retrieves the list of statement expressions contained in this initialization clause. If this clause does not contain any statement expressions, an empty array is returned.

Throws:
JotInvalidElementException

addExpression

public JotStatementExpression addExpression(JotStatementExpression marker,
                                            boolean before,
                                            java.lang.String exp)
                                     throws JotInvalidElementException
Adds a new expression to this initialization clause. If this clause does not currently contain any statement expressions, a new list will be created. This will remove an existing variable declaration.

Parameters:
marker - an existing expression to position relative to, or null if the expression should be positioned at the beginning or end of the update clause.
before - whether to position the new expression before or after the existing marker expression; or if marker is null, whether to position the new expression at the beginning or the end of the update clause
exp - the new expression to add.
Returns:
the newly created expression
Throws:
JotInvalidElementException

removeExpression

public void removeExpression(JotStatementExpression exp)
                      throws JotInvalidElementException
Removes an existing expression from this initialization clause.

Parameters:
exp - the expression to remove
Throws:
JotInvalidElementException

setInitializationText

public void setInitializationText(java.lang.String text)
                           throws JotInvalidElementException
Sets the text of this initialization clause.

Throws:
JotInvalidElementException

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.