java.lang.Object
org.glavo.classfile.impl.CatchBuilderImpl
- All Implemented Interfaces:
CodeBuilder.CatchBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionCatchBuilderImpl(CodeBuilder b, BlockCodeBuilderImpl tryBlock, Label tryCatchEnd) -
Method Summary
Modifier and TypeMethodDescriptioncatching(ClassDesc exceptionType, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler) Adds a catch block that catches an exception of the given type.voidcatchingAll(Consumer<CodeBuilder.BlockCodeBuilder> catchAllHandler) Adds a "catch" block that catches all exceptions.catchingMulti(List<ClassDesc> exceptionTypes, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler) Adds a catch block that catches exceptions of the given types.voidfinish()
-
Constructor Details
-
CatchBuilderImpl
-
-
Method Details
-
catching
public CodeBuilder.CatchBuilder catching(ClassDesc exceptionType, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler) Description copied from interface:CodeBuilder.CatchBuilderAdds 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.
If the type of exception is
nullthen the catch block catches all exceptions.- Specified by:
catchingin interfaceCodeBuilder.CatchBuilder- Parameters:
exceptionType- the type of exception to catch.catchHandler- handler that receives a CodeBuilder to generate the body of the catch block.- Returns:
- this builder
- See Also:
-
catchingMulti
public CodeBuilder.CatchBuilder catchingMulti(List<ClassDesc> exceptionTypes, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler) Description copied from interface:CodeBuilder.CatchBuilderAdds 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.
If the type of exception is
nullthen the catch block catches all exceptions.- Specified by:
catchingMultiin interfaceCodeBuilder.CatchBuilder- Parameters:
exceptionTypes- the types of exception to catch.catchHandler- handler that receives a CodeBuilder to generate the body of the catch block.- Returns:
- this builder
- See Also:
-
catchingAll
Description copied from interface:CodeBuilder.CatchBuilderAdds a "catch" block that catches all exceptions.The caught exception will be on top of the operand stack when the catch block is entered.
- Specified by:
catchingAllin interfaceCodeBuilder.CatchBuilder- Parameters:
catchAllHandler- handler that receives a CodeBuilder to generate the body of the catch block- See Also:
-
finish
public void finish()
-