Extension SDK

oracle.jdeveloper.jot
Interface JotTry

All Superinterfaces:
JotBlockElement, JotElement, JotHasCodeBlock, JotStatement

public interface JotTry
extends JotStatement, JotHasCodeBlock

The JotTry interface represents a try statement. A try statement contains a code block, zero or more catch clauses, and an optional finally clause. A valid try statement must include either at least one catch clause or a finally clause. The statement has the form:

   try
   {
     ...
   }
   catch (Exception ex)
   {
     ...
   }
   finally
   {
     ...
   }
 

Since:
5.0
See Also:
"Section 14.19 of the Java Language Specification Second Edition"

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
 JotCatch addCatchClause(JotCatch marker, boolean before, java.lang.String eType, java.lang.String eName)
          Adds a new catch clause.
 JotCatch addCatchClause(java.lang.String eType, java.lang.String eName)
          Adds a new catch clause at the end of the list of catch clauses.
 JotCodeBlock addFinallyBlock()
          Adds a finally block.
 JotCatch[] getCatchClauses()
          Retrieves the catch clauses associated with this try.
 JotCodeBlock getFinallyBlock()
          Retrieves the finally code block.
 void removeCatchClause(JotCatch catchClause)
          Removes an existing catch clause.
 void removeFinallyBlock()
          Removes the finally clause.
 
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.JotElement
getElementName, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 
Methods inherited from interface oracle.jdeveloper.jot.JotHasCodeBlock
getCodeBlock, setCodeBlockText
 

Method Detail

getCatchClauses

public JotCatch[] getCatchClauses()
Retrieves the catch clauses associated with this try.


addCatchClause

public JotCatch addCatchClause(JotCatch marker,
                               boolean before,
                               java.lang.String eType,
                               java.lang.String eName)
Adds a new catch clause.

Parameters:
marker - the catch to position relative to.
before - whether to position the new catch before or after the marker catch; or, if the marker is null, whether to position the new catch at the beginning or the end of the argumentcatch list.
eType - the exception type
eName - the exception variable name
Returns:
the new catch as a JotCatch.

addCatchClause

public JotCatch addCatchClause(java.lang.String eType,
                               java.lang.String eName)
Adds a new catch clause at the end of the list of catch clauses.

Parameters:
eType - the exception type
eName - the exception variable name
Returns:
the new catch as a JotCatch.

removeCatchClause

public void removeCatchClause(JotCatch catchClause)
Removes an existing catch clause.


getFinallyBlock

public JotCodeBlock getFinallyBlock()
Retrieves the finally code block. If this try statement does not have a finally clause, null is returned.


addFinallyBlock

public JotCodeBlock addFinallyBlock()
Adds a finally block. If the finally clause already exists, the existing one is returned.


removeFinallyBlock

public void removeFinallyBlock()
Removes the finally clause.


Extension SDK

 

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