Extension SDK 9.0.5

oracle.jdeveloper.jot
Interface JotHasChildStatement

All Superinterfaces:
JotBlockElement, JotCodeElement, JotElement, JotStatement
All Known Subinterfaces:
JotConditional, JotDo, JotElse, JotFor, JotIf, JotWhile

public interface JotHasChildStatement
extends JotStatement

The JotHasChildStatement interface describes statements that can contain a single sub-statement.

Since:
5.0

Field Summary
 
Fields inherited from interface oracle.jdeveloper.jot.JotStatement
BLOCK_STATEMENT, BREAK_STATEMENT, CASE_CLAUSE, CONTINUE_STATEMENT, DO_STATEMENT, ELSE_CLAUSE, EMPTY_STATEMENT, EXPRESSION_STATEMENT, FOR_STATEMENT, IF_STATEMENT, RETURN_STATEMENT, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THROW_STATEMENT, TRY_STATEMENT, WHILE_STATEMENT
 
Fields inherited from interface oracle.jdeveloper.jot.JotBlockElement
LOCAL_CLASS_TYPE, STATEMENT_TYPE, VARIABLE_DECLARATION_TYPE
 
Method Summary
 JotBlockStatement addBlock()
          Adds a new block statement as the sub-statement.
 JotBreak addBreak()
          Adds a new break statement as the sub-statement.
 JotContinue addContinue()
          Adds a new continue statement as the sub-statement.
 JotDo addDo(java.lang.String condition)
          Adds a new do statement as the sub-statement.
 JotExpressionStatement addExpressionStatement(JotStatementExpression exp)
          Adds a new expression statement as the sub-statement.
 JotExpressionStatement addExpressionStatement(java.lang.String exp)
          Adds a new expression statement as the sub-statement.
 JotFor addFor()
          Adds a new for statement as the sub-statement.
 JotIf addIf(java.lang.String exp)
          Adds a new if statement as the sub-statement.
 JotReturn addReturn(java.lang.String exp)
          Adds a new return statement as the sub-statement.
 JotStatement addStatement(java.lang.String text)
          Adds a new statement as the sub-statement.
 JotSwitch addSwitch(java.lang.String exp)
          Adds a new switch statement as the sub-statement.
 JotSynchronized addSynchronized(java.lang.String exp)
          Adds a new synchronized statement as the sub-statement.
 JotThrow addThrow(java.lang.String exp)
          Adds a new throw statement as the sub-statement.
 JotTry addTry()
          Adds a new try statement as the sub-statement.
 JotWhile addWhile(java.lang.String condition)
          Adds a new while statement as the sub-statement.
 JotAssignment createAssignment(java.lang.String variable, java.lang.String value)
          Creates a new assignment.
 JotMethodCall createMethodCall(java.lang.String object, java.lang.String method)
          Creates a new method call.
 JotNestedExpression createNestedMethodCall(JotMethodCall firstCall, JotMethodCall secondCall)
          Creates a new nested method call.
 JotStatement getChildStatement()
          Retrieves the sub-statement associated with this statement.
 
Methods inherited from interface oracle.jdeveloper.jot.JotStatement
addLabel, getAsBlock, getAsBreak, getAsCase, getAsContinue, getAsDo, getAsExpressionStatement, getAsFor, getAsIf, getAsReturn, getAsSwitch, getAsSynchronized, getAsThrow, getAsTry, getAsWhile, getLabels, getStatementText, getStatementType, removeLabel
 
Methods inherited from interface oracle.jdeveloper.jot.JotBlockElement
getAsLocalClass, getAsStatement, getAsVariableDeclaration, getElementType
 
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, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 

Method Detail

addBlock

public JotBlockStatement addBlock()
                           throws JotInvalidElementException
Adds a new block statement as the sub-statement. Any existing sub-statement is removed.

Returns:
the JotBlockStatement representing the new block.
Throws:
JotInvalidElementException

addBreak

public JotBreak addBreak()
                  throws JotInvalidElementException
Adds a new break statement as the sub-statement. Any existing sub-statement is removed.

Returns:
the JotBreak representing the break statement.
Throws:
JotInvalidElementException

addContinue

public JotContinue addContinue()
                        throws JotInvalidElementException
Adds a new continue statement as the sub-statement. Any existing sub-statement is removed.

Returns:
the JotContinue representing the continue statement.
Throws:
JotInvalidElementException

addReturn

public JotReturn addReturn(java.lang.String exp)
                    throws JotInvalidElementException
Adds a new return statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the return expression; null create return without a value;
Returns:
the JotReturn representing the return statement.
Throws:
JotInvalidElementException

addThrow

public JotThrow addThrow(java.lang.String exp)
                  throws JotInvalidElementException
Adds a new throw statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the value being thrown.
Returns:
the JotThrow representing the throw statement.
Throws:
JotInvalidElementException

addDo

public JotDo addDo(java.lang.String condition)
            throws JotInvalidElementException
Adds a new do statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
condition - the conditional expression.
Returns:
the JotDo representing the do statement.
Throws:
JotInvalidElementException

addWhile

public JotWhile addWhile(java.lang.String condition)
                  throws JotInvalidElementException
Adds a new while statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
condition - the conditional expression.
Returns:
the JotWhile representing the while statement.
Throws:
JotInvalidElementException

addIf

public JotIf addIf(java.lang.String exp)
            throws JotInvalidElementException
Adds a new if statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the conditional expression.
Returns:
the JotIf representing the if statement.
Throws:
JotInvalidElementException

addFor

public JotFor addFor()
              throws JotInvalidElementException
Adds a new for statement as the sub-statement. Any existing sub-statement is removed.

Returns:
the JotFor representing the for statement.
Throws:
JotInvalidElementException

addSwitch

public JotSwitch addSwitch(java.lang.String exp)
                    throws JotInvalidElementException
Adds a new switch statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the expression being switched on.
Returns:
the JotSwitch representing the switch statement.
Throws:
JotInvalidElementException

addSynchronized

public JotSynchronized addSynchronized(java.lang.String exp)
                                throws JotInvalidElementException
Adds a new synchronized statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the expression being synchronized on.
Returns:
the JotSynchronized representing the synchronized statement.
Throws:
JotInvalidElementException

addExpressionStatement

public JotExpressionStatement addExpressionStatement(java.lang.String exp)
                                              throws JotInvalidElementException
Adds a new expression statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the expression being wrapped.
Returns:
the JotExpressionStatement representing the expression statement.
Throws:
JotInvalidElementException

addExpressionStatement

public JotExpressionStatement addExpressionStatement(JotStatementExpression exp)
                                              throws JotInvalidElementException
Adds a new expression statement as the sub-statement. Any existing sub-statement is removed.

Parameters:
exp - the statement expression to wrap.
Returns:
the JotExpressionStatement representing the expression statement.
Throws:
JotInvalidElementException

addTry

public JotTry addTry()
              throws JotInvalidElementException
Adds a new try statement as the sub-statement. Any existing sub-statement is removed.

Returns:
the JotTry representing the try statement.
Throws:
JotInvalidElementException

addStatement

public JotStatement addStatement(java.lang.String text)
                          throws JotInvalidElementException,
                                 JotException
Adds a new statement as the sub-statement. The statement text should properly terminated. Blocks should include the braces.

Parameters:
text - the text of the new statement.
Throws:
JotException - if the new text cannot be parsed into a single statement.
JotInvalidElementException

createMethodCall

public JotMethodCall createMethodCall(java.lang.String object,
                                      java.lang.String method)
                               throws JotInvalidElementException
Creates a new method call. This method call should then be added to the code block by calling addExpressionStatement or added to a nested method call by calling createNestedMethodCall.

Parameters:
object - the object on which the method call is being made.
method - the name of the method being invoked.
Returns:
the JotMethodCall representing the method call.
Throws:
JotInvalidElementException
See Also:
addExpressionStatement(JotStatementExpression), createNestedMethodCall(JotMethodCall, JotMethodCall)

createNestedMethodCall

public JotNestedExpression createNestedMethodCall(JotMethodCall firstCall,
                                                  JotMethodCall secondCall)
                                           throws JotInvalidElementException
Creates a new nested method call. A nested method call consists of two method calls connected with the '.' operator; for example, foo().bar().

Parameters:
firstCall - the first method call.
secondCall - the second method call.
Returns:
the JotNestedExpression representing the nested method call.
Throws:
JotInvalidElementException
See Also:
createMethodCall(String, String)

createAssignment

public JotAssignment createAssignment(java.lang.String variable,
                                      java.lang.String value)
                               throws JotInvalidElementException
Creates a new assignment. This assignment should then be added to the code block by calling addExpressionStatement.

Parameters:
variable - the variable (or left side) of the assignment.
value - the expression being assigned to the variable.
Returns:
the JotAssignment representing the assignment.
Throws:
JotInvalidElementException
See Also:
addExpressionStatement(JotStatementExpression)

getChildStatement

public JotStatement getChildStatement()
                               throws JotInvalidElementException
Retrieves the sub-statement associated with this statement.

Returns:
the sub-statement.
Throws:
JotInvalidElementException

Extension SDK

 

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