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"
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 |
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.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 |
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
Copyright © 1997, 2004, Oracle. All rights reserved.