Top Description Methods
java.lang.classfile.instruction

public sealed Interface ExceptionCatch

extends PseudoInstruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractPseudoInstruction.ExceptionCatchImpl
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.util.Optional, java.lang.classfile.CodeElement, .CodeModel, .Label, .PseudoInstruction, java.lang.classfile.constantpool.ClassEntry, jdk.internal.classfile.impl.AbstractPseudoInstruction, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use ExceptionCatch when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

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
PseudoInstruction

Method Summary

Modifier and TypeMethod and Description
public Optional<ClassEntry>

Returns:

the type of the exception to catch, or empty if this handler is unconditional
catchType
()

Returns the type of the exception to catch, or empty if this handler is unconditional.

public Label

Returns:

the handler for the exception
handler
()

Returns the handler for the exception.

public static ExceptionCatch

Returns:

an exception table pseudo-instruction
of
(Label
the handler for the exception
handler
,
Label
the beginning of the instruction range for the guarded instructions
tryStart
,
Label
the end of the instruction range for the guarded instructions
tryEnd
,
Optional<ClassEntry>
the type of exception to catch, or empty if this handler is unconditional
catchTypeEntry
)

Returns an exception table pseudo-instruction.

public static ExceptionCatch

Returns:

an exception table pseudo-instruction for an unconditional handler
of
(Label
the handler for the exception
handler
,
Label
the beginning of the instruction range for the gaurded instructions
tryStart
,
Label
the end of the instruction range for the gaurded instructions
tryEnd
)

Returns an exception table pseudo-instruction for an unconditional handler.

public Label

Returns:

the end of the instruction range for the guarded instructions
tryEnd
()

Returns the end of the instruction range for the guarded instructions.

public Label

Returns:

the beginning of the instruction range for the guarded instructions
tryStart
()

Returns the beginning of the instruction range for the guarded instructions.

Method Detail

catchTypeback to summary
public Optional<ClassEntry> catchType()

Returns the type of the exception to catch, or empty if this handler is unconditional.

Returns:Optional<ClassEntry>

the type of the exception to catch, or empty if this handler is unconditional

handlerback to summary
public Label handler()

Returns the handler for the exception.

Returns:Label

the handler for the exception

ofback to summary
public static ExceptionCatch of(Label handler, Label tryStart, Label tryEnd, Optional<ClassEntry> catchTypeEntry)

Returns an exception table pseudo-instruction.

Parameters
handler:Label

the handler for the exception

tryStart:Label

the beginning of the instruction range for the guarded instructions

tryEnd:Label

the end of the instruction range for the guarded instructions

catchTypeEntry:Optional<ClassEntry>

the type of exception to catch, or empty if this handler is unconditional

Returns:ExceptionCatch

an exception table pseudo-instruction

ofback to summary
public static ExceptionCatch of(Label handler, Label tryStart, Label tryEnd)

Returns an exception table pseudo-instruction for an unconditional handler.

Parameters
handler:Label

the handler for the exception

tryStart:Label

the beginning of the instruction range for the gaurded instructions

tryEnd:Label

the end of the instruction range for the gaurded instructions

Returns:ExceptionCatch

an exception table pseudo-instruction for an unconditional handler

tryEndback to summary
public Label tryEnd()

Returns the end of the instruction range for the guarded instructions.

Returns:Label

the end of the instruction range for the guarded instructions

tryStartback to summary
public Label tryStart()

Returns the beginning of the instruction range for the guarded instructions.

Returns:Label

the beginning of the instruction range for the guarded instructions