Uses of Interface
java.lang.classfile.ClassBuilder
Package
Description
Provides classfile parsing, generation, and transformation library.
-
Uses of ClassBuilderPREVIEW in java.lang.classfilePREVIEW
Modifier and TypeInterfaceDescriptioninterface
Preview.A builder for classfiles.interface
Preview.A transformation on streams ofClassElement
PREVIEW.Modifier and TypeMethodDescriptionClassBuilder.transformField
(FieldModelPREVIEW field, FieldTransformPREVIEW transform) Adds a field by transforming a field from another class.ClassBuilder.transformMethod
(MethodModelPREVIEW method, MethodTransformPREVIEW transform) Adds a method by transforming a method from another class.default ClassBuilderPREVIEW
Adds a field.ClassBuilder.withField
(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, Consumer<? super FieldBuilderPREVIEW> handler) Adds a field.default ClassBuilderPREVIEW
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.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 aCode
attribute.default ClassBuilderPREVIEW
ClassBuilder.withMethodBody
(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super CodeBuilderPREVIEW> handler) Adds a method, with only aCodeAttribute
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.Modifier and TypeMethodDescriptionbyte[]
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
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.