Uses of Interface java.lang.classfile.ClassBuilder (Java SE 23 & JDK 23)
Description: use: module: java.base, package: java.lang.classfile, interface: ClassBuilder

# Uses of Interface
java.lang.classfile.ClassBuilder

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

- ## Uses of ClassBuilderPREVIEW in java.lang.classfilePREVIEW

  Subinterfaces with type arguments of type ClassBuilderPREVIEW in java.lang.classfilePREVIEW
  Modifier and Type
  Interface
  Description
  `interface`
  `ClassBuilderPREVIEW`
  Preview.
  A builder for classfiles.
  `interface`
  `ClassTransformPREVIEW`
  Preview.
  A transformation on streams of `ClassElement`PREVIEW.
  Methods in java.lang.classfilePREVIEW that return ClassBuilderPREVIEW
  Modifier and Type
  Method
  Description
  `ClassBuilderPREVIEW`
  ClassBuilder.`transformField(FieldModelPREVIEW field, FieldTransformPREVIEW transform)`
  Adds a field by transforming a field from another class.
  `ClassBuilderPREVIEW`
  ClassBuilder.`transformMethod(MethodModelPREVIEW method, MethodTransformPREVIEW transform)`
  Adds a method by transforming a method from another class.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withField(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, int flags)`
  Adds a field.
  `ClassBuilderPREVIEW`
  ClassBuilder.`withField(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, Consumer<? super FieldBuilderPREVIEW> handler)`
  Adds a field.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withField(String name, ClassDesc descriptor, int flags)`
  Adds a field.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withField(String name, ClassDesc descriptor, Consumer<? super FieldBuilderPREVIEW> handler)`
  Adds a field.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withFlags(int flags)`
  Sets the classfile access flags.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withFlags(AccessFlag... flags)`
  Sets the classfile access flags.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withInterfaces(ClassEntryPREVIEW... interfaces)`
  Sets the interfaces of this class.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withInterfaces(List<ClassEntryPREVIEW> interfaces)`
  Sets the interfaces of this class.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withInterfaceSymbols(ClassDesc... interfaces)`
  Sets the interfaces of this class.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withInterfaceSymbols(List<ClassDesc> interfaces)`
  Sets the interfaces of this class.
  `ClassBuilderPREVIEW`
  ClassBuilder.`withMethod(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, int methodFlags, Consumer<? super MethodBuilderPREVIEW> handler)`
  Adds a method.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withMethod(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super MethodBuilderPREVIEW> handler)`
  Adds a method.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withMethodBody(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, int methodFlags, Consumer<? super CodeBuilderPREVIEW> handler)`
  Adds a method, with only a `Code` attribute.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withMethodBody(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super CodeBuilderPREVIEW> handler)`
  Adds a method, with only a `CodeAttribute`PREVIEW.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withSuperclass(ClassEntryPREVIEW superclassEntry)`
  Sets the superclass of this class.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withSuperclass(ClassDesc desc)`
  Sets the superclass of this class.
  `default ClassBuilderPREVIEW`
  ClassBuilder.`withVersion(int major, int minor)`
  Sets the classfile version.
  Methods in java.lang.classfilePREVIEW with parameters of type ClassBuilderPREVIEW
  Modifier and Type
  Method
  Description
  `default ClassFileTransform.ResolvedTransformPREVIEW<ClassElementPREVIEW>`
  ClassTransform.`resolve(ClassBuilderPREVIEW builder)`
  Method parameters in java.lang.classfilePREVIEW with type arguments of type ClassBuilderPREVIEW
  Modifier and Type
  Method
  Description
  `byte[]`
  ClassFile.`build(ClassEntryPREVIEW thisClassEntry, ConstantPoolBuilderPREVIEW constantPool, Consumer<? super ClassBuilderPREVIEW> handler)`
  Build a classfile into a byte array using the provided constant pool builder.
  `default byte[]`
  ClassFile.`build(ClassDesc thisClass, Consumer<? super ClassBuilderPREVIEW> handler)`
  Build a classfile into a byte array.
  `default byte[]`
  ClassFile.`buildModule(ModuleAttributePREVIEW moduleAttribute, Consumer<? super ClassBuilderPREVIEW> handler)`
  Build a module descriptor into a byte array.
  `default void`
  ClassFile.`buildModuleTo(Path path, ModuleAttributePREVIEW moduleAttribute, Consumer<? super ClassBuilderPREVIEW> handler)`
  Build a module descriptor into a file.
  `default void`
  ClassFile.`buildTo(Path path, ClassEntryPREVIEW thisClassEntry, ConstantPoolBuilderPREVIEW constantPool, Consumer<? super ClassBuilderPREVIEW> handler)`
  Build a classfile into a file using the provided constant pool builder.
  `default void`
  ClassFile.`buildTo(Path path, ClassDesc thisClass, Consumer<ClassBuilderPREVIEW> handler)`
  Build a classfile into a file.
  `static ClassTransformPREVIEW`
  ClassTransform.`endHandler(Consumer<ClassBuilderPREVIEW> finisher)`
  Create a class transform that passes each element through to the builder, and calls the specified function when transformation is complete.