# Uses of Interface
java.lang.classfile.CodeBuilder

Packages that use CodeBuilder
Package
Description
java.lang.classfile
Provides classfile parsing, generation, and transformation library.

## Uses of CodeBuilder in java.lang.classfile

Subinterfaces of CodeBuilder in java.lang.classfile
Modifier and Type
Interface
Description
`static interface`
`CodeBuilder.BlockCodeBuilder`
A builder for blocks of code.
Subinterfaces with type arguments of type CodeBuilder in java.lang.classfile
Modifier and Type
Interface
Description
`interface`
`CodeBuilder`
A builder for `Code` attributes (method bodies).
`interface`
`CodeTransform`
A transformation on streams of `CodeElement`.
Methods in java.lang.classfile that return CodeBuilder
Modifier and Type
Method
Description
`default CodeBuilder`
CodeBuilder.`aaload()`
Generates an instruction to load from a `reference` array.
`default CodeBuilder`
CodeBuilder.`aastore()`
Generates an instruction to store into a `reference` array.
`default CodeBuilder`
CodeBuilder.`aconst_null()`
Generates an instruction pushing the null object `reference` onto the operand stack.
`default CodeBuilder`
CodeBuilder.`aload(int slot)`
Generates an instruction to load a `reference` from a local variable.
`default CodeBuilder`
CodeBuilder.`anewarray(ClassEntry classEntry)`
Generates an instruction to create a new array of `reference`.
`default CodeBuilder`
CodeBuilder.`anewarray(ClassDesc className)`
Generates an instruction to create a new array of `reference`.
`default CodeBuilder`
CodeBuilder.`areturn()`
Generates an instruction to return a `reference` from this method.
`default CodeBuilder`
CodeBuilder.`arraylength()`
Generates an instruction to get the length of an array.
`default CodeBuilder`
CodeBuilder.`arrayLoad(TypeKind tk)`
Generates an instruction to load from an array.
`default CodeBuilder`
CodeBuilder.`arrayStore(TypeKind tk)`
Generates an instruction to store into an array.
`default CodeBuilder`
CodeBuilder.`astore(int slot)`
Generates an instruction to store a `reference` into a local variable.
`default CodeBuilder`
CodeBuilder.`athrow()`
Generates an instruction to throw an exception or error.
`default CodeBuilder`
CodeBuilder.`baload()`
Generates an instruction to load from a `byte` or `boolean` array.
`default CodeBuilder`
CodeBuilder.`bastore()`
Generates an instruction to store into a `byte` or `boolean` array.
`default CodeBuilder`
CodeBuilder.`bipush(int b)`
Generates an instruction pushing an `int` in the range of `byte` (`[-128, 127]`) onto the operand stack.
`default CodeBuilder`
CodeBuilder.`block(Consumer<CodeBuilder.BlockCodeBuilder> handler)`
Adds a lexical block to the method being built.
`default CodeBuilder`
CodeBuilder.`branch(Opcode op, Label target)`
Generates a branch instruction.
`default CodeBuilder`
CodeBuilder.`caload()`
Generates an instruction to load from a `char` array.
`default CodeBuilder`
CodeBuilder.`castore()`
Generates an instruction to store into a `char` array.
`default CodeBuilder`
CodeBuilder.`characterRange(Label startScope, Label endScope, int characterRangeStart, int characterRangeEnd, int flags)`
Declares a character range entry.
`default CodeBuilder`
CodeBuilder.`checkcast(ClassEntry type)`
Generates an instruction to check whether an object is of the given type, throwing a `ClassCastException` if the check fails.
`default CodeBuilder`
CodeBuilder.`checkcast(ClassDesc type)`
Generates an instruction to check whether an object is of the given type, throwing a `ClassCastException` if the check fails.
`default CodeBuilder`
CodeBuilder.`conversion(TypeKind fromType, TypeKind toType)`
Generates instruction(s) to convert `fromType` to `toType`.
`default CodeBuilder`
CodeBuilder.`d2f()`
Generates an instruction to convert a `double` into a `float`.
`default CodeBuilder`
CodeBuilder.`d2i()`
Generates an instruction to convert a `double` into an `int`.
`default CodeBuilder`
CodeBuilder.`d2l()`
Generates an instruction to convert a `double` into a `long`.
`default CodeBuilder`
CodeBuilder.`dadd()`
Generates an instruction to add two `doubles`.
`default CodeBuilder`
CodeBuilder.`daload()`
Generates an instruction to load from a `double` array.
`default CodeBuilder`
CodeBuilder.`dastore()`
Generates an instruction to store into a `double` array.
`default CodeBuilder`
CodeBuilder.`dcmpg()`
Generates an instruction to compare two `doubles`, producing `1` if any operand is `NaN`.
`default CodeBuilder`
CodeBuilder.`dcmpl()`
Generates an instruction to compare two `doubles`, producing `-1` if any operand is `NaN`.
`default CodeBuilder`
CodeBuilder.`dconst_0()`
Generates an instruction pushing `double` constant 0 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`dconst_1()`
Generates an instruction pushing `double` constant 1 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`ddiv()`
Generates an instruction to divide `doubles`.
`default CodeBuilder`
CodeBuilder.`dload(int slot)`
Generates an instruction to load a `double` from a local variable.
`default CodeBuilder`
CodeBuilder.`dmul()`
Generates an instruction to multiply `doubles`.
`default CodeBuilder`
CodeBuilder.`dneg()`
Generates an instruction to negate a `double`.
`default CodeBuilder`
CodeBuilder.`drem()`
Generates an instruction to calculate `double` remainder.
`default CodeBuilder`
CodeBuilder.`dreturn()`
Generates an instruction to return a `double` from this method.
`default CodeBuilder`
CodeBuilder.`dstore(int slot)`
Generates an instruction to store a `double` into a local variable.
`default CodeBuilder`
CodeBuilder.`dsub()`
Generates an instruction to subtract `doubles`.
`default CodeBuilder`
CodeBuilder.`dup()`
Generates an instruction to duplicate the top operand stack value.
`default CodeBuilder`
CodeBuilder.`dup_x1()`
Generates an instruction to duplicate the top operand stack value and insert two values down.
`default CodeBuilder`
CodeBuilder.`dup_x2()`
Generates an instruction to duplicate the top operand stack value and insert two or three values down.
`default CodeBuilder`
CodeBuilder.`dup2()`
Generates an instruction to duplicate the top one or two operand stack value.
`default CodeBuilder`
CodeBuilder.`dup2_x1()`
Generates an instruction to duplicate the top one or two operand stack values and insert two or three values down.
`default CodeBuilder`
CodeBuilder.`dup2_x2()`
Generates an instruction to duplicate the top one or two operand stack values and insert two, three, or four values down.
`default CodeBuilder`
CodeBuilder.`exceptionCatch(Label start, Label end, Label handler, ClassEntry catchType)`
Declares an exception table entry.
`default CodeBuilder`
CodeBuilder.`exceptionCatch(Label start, Label end, Label handler, ClassDesc catchType)`
Declares an exception table entry.
`default CodeBuilder`
CodeBuilder.`exceptionCatch(Label start, Label end, Label handler, Optional<ClassEntry> catchType)`
Declares an exception table entry.
`default CodeBuilder`
CodeBuilder.`exceptionCatchAll(Label start, Label end, Label handler)`
Declares an exception table entry catching all exceptions and errors.
`default CodeBuilder`
CodeBuilder.`f2d()`
Generates an instruction to convert a `float` into a `double`.
`default CodeBuilder`
CodeBuilder.`f2i()`
Generates an instruction to convert a `float` into an `int`.
`default CodeBuilder`
CodeBuilder.`f2l()`
Generates an instruction to convert a `float` into a `long`.
`default CodeBuilder`
CodeBuilder.`fadd()`
Generates an instruction to add two `floats`.
`default CodeBuilder`
CodeBuilder.`faload()`
Generates an instruction to load from a `float` array.
`default CodeBuilder`
CodeBuilder.`fastore()`
Generates an instruction to store into a `float` array.
`default CodeBuilder`
CodeBuilder.`fcmpg()`
Generates an instruction to compare `floats`, producing `1` if any operand is `NaN`.
`default CodeBuilder`
CodeBuilder.`fcmpl()`
Generates an instruction to compare `floats`, producing `-1` if any operand is `NaN`.
`default CodeBuilder`
CodeBuilder.`fconst_0()`
Generates an instruction pushing `float` constant 0 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`fconst_1()`
Generates an instruction pushing `float` constant 1 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`fconst_2()`
Generates an instruction pushing `float` constant 2 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`fdiv()`
Generates an instruction to divide `floats`.
`default CodeBuilder`
CodeBuilder.`fieldAccess(Opcode opcode, FieldRefEntry ref)`
Generates an instruction to access a field.
`default CodeBuilder`
CodeBuilder.`fieldAccess(Opcode opcode, ClassDesc owner, String name, ClassDesc type)`
Generates an instruction to access a field.
`default CodeBuilder`
CodeBuilder.`fload(int slot)`
Generates an instruction to load a `float` from a local variable.
`default CodeBuilder`
CodeBuilder.`fmul()`
Generates an instruction to multiply `floats`.
`default CodeBuilder`
CodeBuilder.`fneg()`
Generates an instruction to negate a `float`.
`default CodeBuilder`
CodeBuilder.`frem()`
Generates an instruction to calculate `floats` remainder.
`default CodeBuilder`
CodeBuilder.`freturn()`
Generates an instruction to return a `float` from this method.
`default CodeBuilder`
CodeBuilder.`fstore(int slot)`
Generates an instruction to store a `float` into a local variable.
`default CodeBuilder`
CodeBuilder.`fsub()`
Generates an instruction to subtract `floats`.
`default CodeBuilder`
CodeBuilder.`getfield(FieldRefEntry ref)`
Generates an instruction to fetch field from an object.
`default CodeBuilder`
CodeBuilder.`getfield(ClassDesc owner, String name, ClassDesc type)`
Generates an instruction to fetch field from an object.
`default CodeBuilder`
CodeBuilder.`getstatic(FieldRefEntry ref)`
Generates an instruction to get static field from a class or interface.
`default CodeBuilder`
CodeBuilder.`getstatic(ClassDesc owner, String name, ClassDesc type)`
Generates an instruction to get static field from a class or interface.
`default CodeBuilder`
CodeBuilder.`goto_(Label target)`
Generates an instruction to branch always.
`default CodeBuilder`
CodeBuilder.`goto_w(Label target)`
Generates an instruction to branch always with wide index.
`default CodeBuilder`
CodeBuilder.`i2b()`
Generates an instruction to truncate an `int` into the range of `byte` and sign-extend it.
`default CodeBuilder`
CodeBuilder.`i2c()`
Generates an instruction to truncate an `int` into the range of `char` and zero-extend it.
`default CodeBuilder`
CodeBuilder.`i2d()`
Generates an instruction to convert an `int` into a `double`.
`default CodeBuilder`
CodeBuilder.`i2f()`
Generates an instruction to convert an `int` into a `float`.
`default CodeBuilder`
CodeBuilder.`i2l()`
Generates an instruction to convert an `int` into a `long`.
`default CodeBuilder`
CodeBuilder.`i2s()`
Generates an instruction to truncate an `int` into the range of `short` and sign-extend it.
`default CodeBuilder`
CodeBuilder.`iadd()`
Generates an instruction to add two `ints`.
`default CodeBuilder`
CodeBuilder.`iaload()`
Generates an instruction to load from an `int` array.
`default CodeBuilder`
CodeBuilder.`iand()`
Generates an instruction to calculate bitwise AND of `ints`, also used for `boolean` AND.
`default CodeBuilder`
CodeBuilder.`iastore()`
Generates an instruction to store into an `int` array.
`default CodeBuilder`
CodeBuilder.`iconst_0()`
Generates an instruction pushing `int` constant 0 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`iconst_1()`
Generates an instruction pushing `int` constant 1 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`iconst_2()`
Generates an instruction pushing `int` constant 2 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`iconst_3()`
Generates an instruction pushing `int` constant 3 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`iconst_4()`
Generates an instruction pushing `int` constant 4 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`iconst_5()`
Generates an instruction pushing `int` constant 5 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`iconst_m1()`
Generates an instruction pushing `int` constant -1 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`idiv()`
Generates an instruction to divide `ints`.
`default CodeBuilder`
CodeBuilder.`if_acmpeq(Label target)`
Generates an instruction to branch if `reference` comparison `operand1 == operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_acmpne(Label target)`
Generates an instruction to branch if `reference` comparison `operand1 != operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_icmpeq(Label target)`
Generates an instruction to branch if `int` comparison `operand1 == operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_icmpge(Label target)`
Generates an instruction to branch if `int` comparison `operand1 >= operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_icmpgt(Label target)`
Generates an instruction to branch if `int` comparison `operand1 > operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_icmple(Label target)`
Generates an instruction to branch if `int` comparison `operand1 <= operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_icmplt(Label target)`
Generates an instruction to branch if `int` comparison `operand1 < operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`if_icmpne(Label target)`
Generates an instruction to branch if `int` comparison `operand1 != operand2` succeeds.
`default CodeBuilder`
CodeBuilder.`ifeq(Label target)`
Generates an instruction to branch if `int` comparison with zero `== 0` succeeds.
`default CodeBuilder`
CodeBuilder.`ifge(Label target)`
Generates an instruction to branch if `int` comparison with zero `>= 0` succeeds.
`default CodeBuilder`
CodeBuilder.`ifgt(Label target)`
Generates an instruction to branch if `int` comparison with zero `> 0` succeeds.
`default CodeBuilder`
CodeBuilder.`ifle(Label target)`
Generates an instruction to branch if `int` comparison with zero `<= 0` succeeds.
`default CodeBuilder`
CodeBuilder.`iflt(Label target)`
Generates an instruction to branch if `int` comparison with zero `< 0` succeeds.
`default CodeBuilder`
CodeBuilder.`ifne(Label target)`
Generates an instruction to branch if `int` comparison with zero `!= 0` succeeds.
`default CodeBuilder`
CodeBuilder.`ifnonnull(Label target)`
Generates an instruction to branch if `reference` is not `null`.
`default CodeBuilder`
CodeBuilder.`ifnull(Label target)`
Generates an instruction to branch if `reference` is `null`.
`default CodeBuilder`
CodeBuilder.`ifThen(Opcode opcode, Consumer<CodeBuilder.BlockCodeBuilder> thenHandler)`
Adds an "if-then" block that is conditional on the value(s) on top of the operand stack in accordance with the given opcode.
`default CodeBuilder`
CodeBuilder.`ifThen(Consumer<CodeBuilder.BlockCodeBuilder> thenHandler)`
Adds an "if-then" block that is conditional on the `boolean` value on top of the operand stack.
`default CodeBuilder`
CodeBuilder.`ifThenElse(Opcode opcode, Consumer<CodeBuilder.BlockCodeBuilder> thenHandler, Consumer<CodeBuilder.BlockCodeBuilder> elseHandler)`
Adds an "if-then-else" block that is conditional on the value(s) on top of the operand stack in accordance with the given opcode.
`default CodeBuilder`
CodeBuilder.`ifThenElse(Consumer<CodeBuilder.BlockCodeBuilder> thenHandler, Consumer<CodeBuilder.BlockCodeBuilder> elseHandler)`
Adds an "if-then-else" block that is conditional on the `boolean` value on top of the operand stack.
`default CodeBuilder`
CodeBuilder.`iinc(int slot, int val)`
Generates an instruction to increment an `int` local variable by a constant.
`default CodeBuilder`
CodeBuilder.`iload(int slot)`
Generates an instruction to load an `int` from a local variable.
`default CodeBuilder`
CodeBuilder.`imul()`
Generates an instruction to multiply `ints`.
`default CodeBuilder`
CodeBuilder.`ineg()`
Generates an instruction to negate an `int`.
`default CodeBuilder`
CodeBuilder.`instanceOf(ClassEntry target)`
Generates an instruction to determine if an object is of the given type, producing a `boolean` result on the operand stack.
`default CodeBuilder`
CodeBuilder.`instanceOf(ClassDesc target)`
Generates an instruction to determine if an object is of the given type, producing a `boolean` result on the operand stack.
`default CodeBuilder`
CodeBuilder.`invoke(Opcode opcode, MemberRefEntry ref)`
Generates an instruction to invoke a method.
`default CodeBuilder`
CodeBuilder.`invoke(Opcode opcode, ClassDesc owner, String name, MethodTypeDesc desc, boolean isInterface)`
Generates an instruction to invoke a method.
`default CodeBuilder`
CodeBuilder.`invokedynamic(InvokeDynamicEntry ref)`
Generates an instruction to invoke a dynamically-computed call site.
`default CodeBuilder`
CodeBuilder.`invokedynamic(DynamicCallSiteDesc ref)`
Generates an instruction to invoke a dynamically-computed call site.
`default CodeBuilder`
CodeBuilder.`invokeinterface(InterfaceMethodRefEntry ref)`
Generates an instruction to invoke an interface method.
`default CodeBuilder`
CodeBuilder.`invokeinterface(ClassDesc owner, String name, MethodTypeDesc type)`
Generates an instruction to invoke an interface method.
`default CodeBuilder`
CodeBuilder.`invokespecial(InterfaceMethodRefEntry ref)`
Generates an instruction to invoke an instance method in an interface; direct invocation of methods of the current class and its supertypes.
`default CodeBuilder`
CodeBuilder.`invokespecial(MethodRefEntry ref)`
Generates an instruction to invoke an instance method in a class; direct invocation of instance initialization methods and methods of the current class and its supertypes.
`default CodeBuilder`
CodeBuilder.`invokespecial(ClassDesc owner, String name, MethodTypeDesc type)`
Generates an instruction to invoke an instance method in a class; direct invocation of instance initialization methods and methods of the current class and its supertypes.
`default CodeBuilder`
CodeBuilder.`invokespecial(ClassDesc owner, String name, MethodTypeDesc type, boolean isInterface)`
Generates an instruction to invoke an instance method; direct invocation of instance initialization methods and methods of the current class and its supertypes.
`default CodeBuilder`
CodeBuilder.`invokestatic(InterfaceMethodRefEntry ref)`
Generates an instruction to invoke a class (static) method of an interface.
`default CodeBuilder`
CodeBuilder.`invokestatic(MethodRefEntry ref)`
Generates an instruction to invoke a class (static) method of a class.
`default CodeBuilder`
CodeBuilder.`invokestatic(ClassDesc owner, String name, MethodTypeDesc type)`
Generates an instruction to invoke a class (static) method of a class.
`default CodeBuilder`
CodeBuilder.`invokestatic(ClassDesc owner, String name, MethodTypeDesc type, boolean isInterface)`
Generates an instruction to invoke a class (static) method.
`default CodeBuilder`
CodeBuilder.`invokevirtual(MethodRefEntry ref)`
Generates an instruction to invoke an instance method; dispatch based on class.
`default CodeBuilder`
CodeBuilder.`invokevirtual(ClassDesc owner, String name, MethodTypeDesc type)`
Generates an instruction to invoke an instance method; dispatch based on class.
`default CodeBuilder`
CodeBuilder.`ior()`
Generates an instruction to calculate bitwise OR of `ints`, also used for `boolean` OR.
`default CodeBuilder`
CodeBuilder.`irem()`
Generates an instruction to calculate `ints` remainder.
`default CodeBuilder`
CodeBuilder.`ireturn()`
Generates an instruction to return an `int` from this method.
`default CodeBuilder`
CodeBuilder.`ishl()`
Generates an instruction to shift an `int` left.
`default CodeBuilder`
CodeBuilder.`ishr()`
Generates an instruction to shift an `int` right.
`default CodeBuilder`
CodeBuilder.`istore(int slot)`
Generates an instruction to store an `int` into a local variable.
`default CodeBuilder`
CodeBuilder.`isub()`
Generates an instruction to subtract `ints`.
`default CodeBuilder`
CodeBuilder.`iushr()`
Generates an instruction to logical shift an `int` right.
`default CodeBuilder`
CodeBuilder.`ixor()`
Generates an instruction to calculate bitwise XOR of `ints`.
`default CodeBuilder`
CodeBuilder.`l2d()`
Generates an instruction to convert a `long` into a `double`.
`default CodeBuilder`
CodeBuilder.`l2f()`
Generates an instruction to convert a `long` into a `float`.
`default CodeBuilder`
CodeBuilder.`l2i()`
Generates an instruction to convert a `long` into an `int`.
`default CodeBuilder`
CodeBuilder.`labelBinding(Label label)`
Binds a label to the current position.
`default CodeBuilder`
CodeBuilder.`ladd()`
Generates an instruction to add two `longs`.
`default CodeBuilder`
CodeBuilder.`laload()`
Generates an instruction to load from a `long` array.
`default CodeBuilder`
CodeBuilder.`land()`
Generates an instruction to calculate bitwise AND of `longs`.
`default CodeBuilder`
CodeBuilder.`lastore()`
Generates an instruction to store into a `long` array.
`default CodeBuilder`
CodeBuilder.`lcmp()`
Generates an instruction to compare `longs`.
`default CodeBuilder`
CodeBuilder.`lconst_0()`
Generates an instruction pushing `long` constant 0 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`lconst_1()`
Generates an instruction pushing `long` constant 1 onto the operand stack.
`default CodeBuilder`
CodeBuilder.`ldc(LoadableConstantEntry entry)`
Generates an instruction pushing an item from the run-time constant pool onto the operand stack.
`default CodeBuilder`
CodeBuilder.`ldc(ConstantDesc value)`
Generates an instruction pushing an item from the run-time constant pool onto the operand stack.
`default CodeBuilder`
CodeBuilder.`ldiv()`
Generates an instruction to divide `longs`.
`default CodeBuilder`
CodeBuilder.`lineNumber(int line)`
Declares a source line number beginning at the current position.
`default CodeBuilder`
CodeBuilder.`lload(int slot)`
Generates an instruction to load a `long` from a local variable.
`default CodeBuilder`
CodeBuilder.`lmul()`
Generates an instruction to multiply `longs`.
`default CodeBuilder`
CodeBuilder.`lneg()`
Generates an instruction to negate a `long`.
`default CodeBuilder`
CodeBuilder.`loadConstant(double value)`
Generates an instruction pushing a constant `double` value onto the operand stack.
`default CodeBuilder`
CodeBuilder.`loadConstant(float value)`
Generates an instruction pushing a constant `float` value onto the operand stack.
`default CodeBuilder`
CodeBuilder.`loadConstant(int value)`
Generates an instruction pushing a constant `int` value onto the operand stack.
`default CodeBuilder`
CodeBuilder.`loadConstant(long value)`
Generates an instruction pushing a constant `long` value onto the operand stack.
`default CodeBuilder`
CodeBuilder.`loadConstant(ConstantDesc value)`
Generates an instruction pushing a constant onto the operand stack.
`default CodeBuilder`
CodeBuilder.`loadLocal(TypeKind tk, int slot)`
Generates an instruction to load a value from a local variable.
`default CodeBuilder`
CodeBuilder.`localVariable(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope)`
Declares a local variable entry.
`default CodeBuilder`
CodeBuilder.`localVariable(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope)`
Declares a local variable entry.
`default CodeBuilder`
CodeBuilder.`localVariableType(int slot, Utf8Entry nameEntry, Utf8Entry signatureEntry, Label startScope, Label endScope)`
Declares a local variable type entry.
`default CodeBuilder`
CodeBuilder.`localVariableType(int slot, String name, Signature signature, Label startScope, Label endScope)`
Declares a local variable type entry.
`default CodeBuilder`
CodeBuilder.`lookupswitch(Label defaultTarget, List<SwitchCase> cases)`
Generates an instruction to access a jump table by key match and jump.
`default CodeBuilder`
CodeBuilder.`lor()`
Generates an instruction to calculate bitwise OR of `longs`.
`default CodeBuilder`
CodeBuilder.`lrem()`
Generates an instruction to calculate `longs` remainder.
`default CodeBuilder`
CodeBuilder.`lreturn()`
Generates an instruction to return a `long` from this method.
`default CodeBuilder`
CodeBuilder.`lshl()`
Generates an instruction to shift a `long` left.
`default CodeBuilder`
CodeBuilder.`lshr()`
Generates an instruction to shift a `long` right.
`default CodeBuilder`
CodeBuilder.`lstore(int slot)`
Generates an instruction to store a `long` into a local variable.
`default CodeBuilder`
CodeBuilder.`lsub()`
Generates an instruction to subtract `longs`.
`default CodeBuilder`
CodeBuilder.`lushr()`
Generates an instruction to logical shift a `long` right.
`default CodeBuilder`
CodeBuilder.`lxor()`
Generates an instruction to calculate bitwise XOR of `longs`.
`default CodeBuilder`
CodeBuilder.`monitorenter()`
Generates an instruction to enter monitor for an object.
`default CodeBuilder`
CodeBuilder.`monitorexit()`
Generates an instruction to exit monitor for an object.
`default CodeBuilder`
CodeBuilder.`multianewarray(ClassEntry array, int dims)`
Generates an instruction to create a new multidimensional array.
`default CodeBuilder`
CodeBuilder.`multianewarray(ClassDesc array, int dims)`
Generates an instruction to create a new multidimensional array.
`default CodeBuilder`
CodeBuilder.`new_(ClassEntry clazz)`
Generates an instruction to create a new object.
`default CodeBuilder`
CodeBuilder.`new_(ClassDesc clazz)`
Generates an instruction to create a new object.
`default CodeBuilder`
CodeBuilder.`newarray(TypeKind typeKind)`
Generates an instruction to create a new array of a primitive type.
`default CodeBuilder`
CodeBuilder.`nop()`
Generates a do-nothing instruction.
`default CodeBuilder`
CodeBuilder.`pop()`
Generates an instruction to pop the top operand stack value.
`default CodeBuilder`
CodeBuilder.`pop2()`
Generates an instruction to pop the top one or two operand stack values.
`default CodeBuilder`
CodeBuilder.`putfield(FieldRefEntry ref)`
Generates an instruction to set field in an object.
`default CodeBuilder`
CodeBuilder.`putfield(ClassDesc owner, String name, ClassDesc type)`
Generates an instruction to set field in an object.
`default CodeBuilder`
CodeBuilder.`putstatic(FieldRefEntry ref)`
Generates an instruction to set static field in a class.
`default CodeBuilder`
CodeBuilder.`putstatic(ClassDesc owner, String name, ClassDesc type)`
Generates an instruction to set static field in a class.
`default CodeBuilder`
CodeBuilder.`return_()`
Generates an instruction to return `void` from this method.
`default CodeBuilder`
CodeBuilder.`return_(TypeKind tk)`
Generates a return instruction.
`default CodeBuilder`
CodeBuilder.`saload()`
Generates an instruction to load from a `short` array.
`default CodeBuilder`
CodeBuilder.`sastore()`
Generates an instruction to store into a `short` array.
`default CodeBuilder`
CodeBuilder.`sipush(int s)`
Generates an instruction pushing an `int` in the range of `short`, `[-32768, 32767]`, onto the operand stack.
`default CodeBuilder`
CodeBuilder.`storeLocal(TypeKind tk, int slot)`
Generates an instruction to store a value to a local variable.
`default CodeBuilder`
CodeBuilder.`swap()`
Generates an instruction to swap the top two operand stack values.
`default CodeBuilder`
CodeBuilder.`tableswitch(int low, int high, Label defaultTarget, List<SwitchCase> cases)`
Generates an instruction to access a jump table by index and jump.
`default CodeBuilder`
CodeBuilder.`tableswitch(Label defaultTarget, List<SwitchCase> cases)`
Generates an instruction to access a jump table by index and jump.
`default CodeBuilder`
CodeBuilder.`transforming(CodeTransform transform, Consumer<CodeBuilder> handler)`
Apply a transform to the code built by a handler, directing results to this builder.
`default CodeBuilder`
CodeBuilder.`trying(Consumer<CodeBuilder.BlockCodeBuilder> tryHandler, Consumer<CodeBuilder.CatchBuilder> catchesHandler)`
Adds a "try-catch" block comprising one try block and zero or more catch blocks.
Method parameters in java.lang.classfile with type arguments of type CodeBuilder
Modifier and Type
Method
Description
`static CodeTransform`
CodeTransform.`endHandler(Consumer<CodeBuilder> finisher)`
Creates a code transform that passes each element through to the builder, and calls the specified function when transformation is complete.
`default CodeBuilder`
CodeBuilder.`transforming(CodeTransform transform, Consumer<CodeBuilder> handler)`
Apply a transform to the code built by a handler, directing results to this builder.
`MethodBuilder`
MethodBuilder.`withCode(Consumer<? super CodeBuilder> code)`
Build the method body for this method.
`default ClassBuilder`
ClassBuilder.`withMethodBody(Utf8Entry name, Utf8Entry descriptor, int methodFlags, Consumer<? super CodeBuilder> handler)`
Adds a method, with only access flags and a `CodeModel`.
`default ClassBuilder`
ClassBuilder.`withMethodBody(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super CodeBuilder> handler)`
Adds a method, with only access flags and a `CodeModel`.