APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.classfile.impl

public final Class CatchBuilderImpl

extends Object
implements CatchBuilder
Class Inheritance
All Implemented Interfaces
java.lang.classfile.CodeBuilder.CatchBuilder
Imports
java.lang.classfile.CodeBuilder, .Label, .Opcode, java.lang.classfile.constantpool.ClassEntry, java.lang.constant.ClassDesc, java.util.ArrayList, .HashSet, .List, .Objects, .Set, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
pack-priv final CodeBuilder
b

pack-priv BlockCodeBuilderImpl
pack-priv final BlockCodeBuilderImpl
pack-priv final Label

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CodeBuilder.CatchBuilder
catching(ClassDesc exceptionType, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler)

Implements java.lang.classfile.CodeBuilder.CatchBuilder.catching.

Adds a catch block that catches an exception of the given type.

public void
catchingAll(Consumer<CodeBuilder.BlockCodeBuilder> catchAllHandler)

Implements java.lang.classfile.CodeBuilder.CatchBuilder.catchingAll.

Adds a "catch" block that catches all exceptions.

public CodeBuilder.CatchBuilder
catchingMulti(List<ClassDesc> exceptionTypes, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler)

Implements java.lang.classfile.CodeBuilder.CatchBuilder.catchingMulti.

Adds a catch block that catches exceptions of the given types.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bback to summary
pack-priv final CodeBuilder b
catchBlockback to summary
pack-priv BlockCodeBuilderImpl catchBlock
tryBlockback to summary
pack-priv final BlockCodeBuilderImpl tryBlock
tryCatchEndback to summary
pack-priv final Label tryCatchEnd

Constructor Detail

CatchBuilderImplback to summary
public CatchBuilderImpl(CodeBuilder b, BlockCodeBuilderImpl tryBlock, Label tryCatchEnd)

Method Detail

catchingback to summary
public CodeBuilder.CatchBuilder catching(ClassDesc exceptionType, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler)

Implements java.lang.classfile.CodeBuilder.CatchBuilder.catching.

Doc from java.lang.classfile.CodeBuilder.CatchBuilder.catching.

Adds a catch block that catches an exception of the given type.

The caught exception will be on top of the operand stack when the catch block is entered.

The BlockCodeBuilder#breakLabel() for the catch block corresponds to the break label of the tryHandler block in trying.

If the type of exception is null then the catch block catches all exceptions.

Annotations
@Override
catchingAllback to summary
public void catchingAll(Consumer<CodeBuilder.BlockCodeBuilder> catchAllHandler)

Implements java.lang.classfile.CodeBuilder.CatchBuilder.catchingAll.

Doc from java.lang.classfile.CodeBuilder.CatchBuilder.catchingAll.

Adds a "catch" block that catches all exceptions.

The BlockCodeBuilder#breakLabel() for the catch block corresponds to the break label of the tryHandler block in trying.

The caught exception will be on top of the operand stack when the catch block is entered.

Annotations
@Override
catchingMultiback to summary
public CodeBuilder.CatchBuilder catchingMulti(List<ClassDesc> exceptionTypes, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler)

Implements java.lang.classfile.CodeBuilder.CatchBuilder.catchingMulti.

Doc from java.lang.classfile.CodeBuilder.CatchBuilder.catchingMulti.

Adds a catch block that catches exceptions of the given types.

The caught exception will be on top of the operand stack when the catch block is entered.

The BlockCodeBuilder#breakLabel() for the catch block corresponds to the break label of the tryHandler block in trying.

If list of exception types is empty then the catch block catches all exceptions.

Annotations
@Override
finishback to summary
public void finish()