- All Superinterfaces:
ClassFileElement,CodeElement,PseudoInstruction
- All Known Implementing Classes:
AbstractPseudoInstruction.ExceptionCatchImpl
public sealed interface ExceptionCatch
extends PseudoInstruction
permits AbstractPseudoInstruction.ExceptionCatchImpl
A pseudo-instruction modeling an entry in the exception table of a code
attribute. Entries in the exception table model catch and finally blocks.
Delivered as a
CodeElement when traversing the contents
of a CodeModel.- Since:
- 22
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the type of the exception to catch, or empty if this handler is unconditional.handler()Returns the handler for the exception.static ExceptionCatchReturns an exception table pseudo-instruction for an unconditional handler.static ExceptionCatchReturns an exception table pseudo-instruction.tryEnd()Returns the end of the instruction range for the guarded instructions.tryStart()Returns the beginning of the instruction range for the guarded instructions.
-
Method Details
-
handler
Label handler()Returns the handler for the exception.- Returns:
- the handler for the exception
-
tryStart
Label tryStart()Returns the beginning of the instruction range for the guarded instructions.- Returns:
- the beginning of the instruction range for the guarded instructions
-
tryEnd
Label tryEnd()Returns the end of the instruction range for the guarded instructions.- Returns:
- the end of the instruction range for the guarded instructions
-
catchType
Optional<ClassEntry> catchType()Returns the type of the exception to catch, or empty if this handler is unconditional.- Returns:
- the type of the exception to catch, or empty if this handler is unconditional
-
of
static ExceptionCatch of(Label handler, Label tryStart, Label tryEnd, Optional<ClassEntry> catchTypeEntry) Returns an exception table pseudo-instruction.- Parameters:
handler- the handler for the exceptiontryStart- the beginning of the instruction range for the guarded instructionstryEnd- the end of the instruction range for the guarded instructionscatchTypeEntry- the type of exception to catch, or empty if this handler is unconditional- Returns:
- an exception table pseudo-instruction
-
of
Returns an exception table pseudo-instruction for an unconditional handler.- Parameters:
handler- the handler for the exceptiontryStart- the beginning of the instruction range for the gaurded instructionstryEnd- the end of the instruction range for the gaurded instructions- Returns:
- an exception table pseudo-instruction for an unconditional handler
-