APIdia Launch Partner
Top Description Methods
java.lang.classfile.instruction

public sealed Interface NewObjectInstruction

extends Instruction
permits BoundNewObjectInstruction, UnboundNewObjectInstruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.BoundNewObjectInstruction, jdk.internal.classfile.impl.AbstractInstruction.UnboundNewObjectInstruction
Imports
java.lang.classfile.CodeBuilder, .CodeElement, .CodeModel, .Instruction, .Opcode, java.lang.classfile.constantpool.ClassEntry, jdk.internal.classfile.impl.AbstractInstruction

Models a new instruction in the code array of a Code attribute. Delivered as a CodeElement when traversing the elements of a CodeModel.

A new object instruction is composite:

NewObjectInstruction(ClassEntry className)
NewObjectInstruction(ClassEntry className)
where the className is a non-abstract class.
Since
24
Java Virtual Machine Specification
6.5.new new
See Also
Opcode.Kind#NEW_OBJECT, CodeBuilder::new_

Method Summary

Modifier and TypeMethod and Description
public ClassEntry

Returns:

the type of object to create
className
()

Returns the type of object to create.

public static NewObjectInstruction

Returns:

a new object instruction
of
(ClassEntry
the type of object to create
className
)

Returns a new object instruction.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

classNameback to summary
public ClassEntry className()

Returns the type of object to create.

Returns:ClassEntry

the type of object to create

ofback to summary
public static NewObjectInstruction of(ClassEntry className)

Returns a new object instruction.

Parameters
className:ClassEntry

the type of object to create

Returns:NewObjectInstruction

a new object instruction