Uses of Interface
java.lang.classfile.ClassBuilder
Packages that use ClassBuilder
Package
Description
Provides classfile parsing, generation, and transformation library.
-
Uses of ClassBuilder in java.lang.classfile
Subinterfaces with type arguments of type ClassBuilder in java.lang.classfileModifier and TypeInterfaceDescriptioninterface
A builder for aclass
file.interface
A transformation on streams ofClassElement
.Methods in java.lang.classfile that return ClassBuilderModifier and TypeMethodDescriptionClassBuilder.transformField
(FieldModel field, FieldTransform transform) Adds a field by transforming a field from another class.ClassBuilder.transformMethod
(MethodModel method, MethodTransform transform) Adds a method by transforming a method from another class.default ClassBuilder
Adds a field, with only access flags.ClassBuilder.withField
(Utf8Entry name, Utf8Entry descriptor, Consumer<? super FieldBuilder> handler) Adds a field.default ClassBuilder
Adds a field, with only access flags.default ClassBuilder
ClassBuilder.withField
(String name, ClassDesc descriptor, Consumer<? super FieldBuilder> handler) Adds a field.default ClassBuilder
ClassBuilder.withFlags
(int flags) Sets the access flags of this class.default ClassBuilder
ClassBuilder.withFlags
(AccessFlag... flags) Sets the access flags of this class.default ClassBuilder
ClassBuilder.withInterfaces
(ClassEntry... interfaces) Sets the interfaces of this class.default ClassBuilder
ClassBuilder.withInterfaces
(List<ClassEntry> interfaces) Sets the interfaces of this class.default ClassBuilder
ClassBuilder.withInterfaceSymbols
(ClassDesc... interfaces) Sets the interfaces of this class.default ClassBuilder
ClassBuilder.withInterfaceSymbols
(List<ClassDesc> interfaces) Sets the interfaces of this class.ClassBuilder.withMethod
(Utf8Entry name, Utf8Entry descriptor, int methodFlags, Consumer<? super MethodBuilder> handler) Adds a method.default ClassBuilder
ClassBuilder.withMethod
(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super MethodBuilder> handler) Adds a method.default ClassBuilder
ClassBuilder.withMethodBody
(Utf8Entry name, Utf8Entry descriptor, int methodFlags, Consumer<? super CodeBuilder> handler) Adds a method, with only access flags and aCodeModel
.default ClassBuilder
ClassBuilder.withMethodBody
(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super CodeBuilder> handler) Adds a method, with only access flags and aCodeModel
.default ClassBuilder
ClassBuilder.withSuperclass
(ClassEntry superclassEntry) Sets the superclass of this class.default ClassBuilder
ClassBuilder.withSuperclass
(ClassDesc desc) Sets the superclass of this class.default ClassBuilder
ClassBuilder.withVersion
(int major, int minor) Sets the version of this class.Method parameters in java.lang.classfile with type arguments of type ClassBuilderModifier and TypeMethodDescriptionbyte[]
ClassFile.build
(ClassEntry thisClassEntry, ConstantPoolBuilder constantPool, Consumer<? super ClassBuilder> handler) Builds aclass
file into a byte array using the provided constant pool builder.default byte[]
ClassFile.build
(ClassDesc thisClass, Consumer<? super ClassBuilder> handler) Builds aclass
file into a byte array.default byte[]
ClassFile.buildModule
(ModuleAttribute moduleAttribute, Consumer<? super ClassBuilder> handler) Builds a module descriptor into a byte array.default void
ClassFile.buildModuleTo
(Path path, ModuleAttribute moduleAttribute, Consumer<? super ClassBuilder> handler) Builds a module descriptor into a file in a file system.default void
ClassFile.buildTo
(Path path, ClassEntry thisClassEntry, ConstantPoolBuilder constantPool, Consumer<? super ClassBuilder> handler) Builds aclass
file into a file in a file system using the provided constant pool builder.default void
ClassFile.buildTo
(Path path, ClassDesc thisClass, Consumer<ClassBuilder> handler) Builds aclass
file into a file in a file system.static ClassTransform
ClassTransform.endHandler
(Consumer<ClassBuilder> finisher) Creates a class transform that passes each element through to the builder, and calls the specified function when transformation is complete.