com.borland.jbuilder.jot
Interface JotTry
- All Superinterfaces:
- JotMarker, JotSourceElement, JotStatement
- public interface JotTry
- extends JotStatement
This interface represents a Java try
statement. For more information
see section 14.18 of the Java Language Specification.
Method Summary |
JotCatch |
addCatch(JotMarker marker,
boolean before,
java.lang.String type,
java.lang.String varName)
Creates an instance of JotCatch and inserts it into the try statement. |
JotCatch[] |
getCatches()
Returns an array of JotCatch objects containing the catch blocks
of this try statement. |
JotCodeBlock |
getCodeBlock()
Returns the code block of the try statement. |
JotFinally |
getFinally()
Returns the finally block of this try statement. |
void |
removeCatch(JotCatch c)
Removes the specified catch block from this try statement. |
addCatch
public JotCatch addCatch(JotMarker marker,
boolean before,
java.lang.String type,
java.lang.String varName)
- Creates an instance of JotCatch and inserts it into the try statement.
- Parameters:
marker
- the Jot object relative to which the code is being addedbefore
- controls where, relative to the marker, code will be added.
true
places the statement before the marker false
places the statement after the marker.type
- is the Exception being caughtvarName
- is the variable name to be used for the Exception
removeCatch
public void removeCatch(JotCatch c)
- Removes the specified catch block from this try statement. If the
catch isn't in this block, then does nothing.
getCatches
public JotCatch[] getCatches()
- Returns an array of JotCatch objects containing the
catch
blocks
of this try
statement. If there are no catch
blocks
then returns a zero-length array.
getFinally
public JotFinally getFinally()
- Returns the
finally
block of this try
statement.
If there is no finally
block, then returns null
.
getCodeBlock
public JotCodeBlock getCodeBlock()
- Returns the code block of the
try
statement.
- Specified by:
getCodeBlock
in interface JotStatement