Extension SDK 10.1.2


oracle.jdeveloper.jot
Interface JotTry

All Superinterfaces:
JotBlockElement, JotCodeElement, 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.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

Methods inherited from interface oracle.jdeveloper.jot.JotHasCodeBlock
getCodeBlock, setCodeBlockText

Method Detail

getCatchClauses

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

addCatchClause

public JotCatch addCatchClause(JotCatch marker,
                               boolean before,
                               java.lang.String eType,
                               java.lang.String eName)
                        throws JotInvalidElementException
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.
Throws:
JotInvalidElementException

addCatchClause

public JotCatch addCatchClause(java.lang.String eType,
                               java.lang.String eName)
                        throws JotInvalidElementException
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.
Throws:
JotInvalidElementException

removeCatchClause

public void removeCatchClause(JotCatch catchClause)
                       throws JotInvalidElementException
Removes an existing catch clause.
Throws:
JotInvalidElementException

getFinallyBlock

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

addFinallyBlock

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

removeFinallyBlock

public void removeFinallyBlock()
                        throws JotInvalidElementException
Removes the finally clause.
Throws:
JotInvalidElementException

Extension SDK


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