Interface ClassFileBuilder<E extends ClassFileElement, B extends ClassFileBuilder<E,B>>
- Type Parameters:
E
- the element typeB
- the builder type
- All Superinterfaces:
Consumer<E>
- All Known Subinterfaces:
ClassBuilder
,CodeBuilder
,CodeBuilder.BlockCodeBuilder
,FieldBuilder
,MethodBuilder
public sealed interface ClassFileBuilder<E extends ClassFileElement, B extends ClassFileBuilder<E,B>>
extends Consumer<E>
permits ClassBuilder, FieldBuilder, MethodBuilder, CodeBuilder
A builder for a classfile or portion of a classfile. Builders are rarely
created directly; they are passed to handlers by methods such as
ClassFile.build(ClassDesc, Consumer)
or to transforms.
Elements of the newly built entity can be specified
abstractly (by passing a ClassFileElement
to with(ClassFileElement)
or concretely by calling the various withXxx
methods.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Integrate theClassFileElement
into the entity being built.Returns the constant pool builder associated with this builder.default B
transform
(CompoundElement<E> model, ClassFileTransform<?, E, B> transform) Apply a transform to a model, directing results to this builder.Integrate theClassFileElement
into the entity being built.
-
Method Details
-
accept
Integrate theClassFileElement
into the entity being built.- Specified by:
accept
in interfaceConsumer<E extends ClassFileElement>
- Parameters:
e
- the element
-
with
Integrate theClassFileElement
into the entity being built.- Parameters:
e
- the element- Returns:
- this builder
-
constantPool
ConstantPoolBuilder constantPool()Returns the constant pool builder associated with this builder.- Returns:
- the constant pool builder associated with this builder
-
transform
Apply a transform to a model, directing results to this builder.- Parameters:
model
- the model to transformtransform
- the transform to apply- Returns:
- this builder
-