- All Superinterfaces:
ClassfileBuilder<FieldElement,,FieldBuilder> Consumer<FieldElement>
- All Known Subinterfaces:
TerminalFieldBuilder
- All Known Implementing Classes:
BufferedFieldBuilder,ChainedFieldBuilder,DirectFieldBuilder
public sealed interface FieldBuilder
extends ClassfileBuilder<FieldElement,FieldBuilder>
permits TerminalFieldBuilder, ChainedFieldBuilder
A builder for fields. Builders are not created directly; they are passed
to handlers by methods such as
ClassBuilder.withField(Utf8Entry, Utf8Entry, Consumer)
or to field transforms. The elements of a field can be specified
abstractly (by passing a FieldElement to ClassfileBuilder.with(ClassfileElement)
or concretely by calling the various withXxx methods.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionoriginal()Returns theFieldModelrepresenting the field being transformed, if this field builder represents the transformation of someFieldModel.default FieldBuilderwithFlags(int flags) Sets the field access flags.default FieldBuilderwithFlags(AccessFlag... flags) Sets the field access flags.Methods inherited from interface org.glavo.classfile.ClassfileBuilder
accept, canWriteDirect, constantPool, transform, with
-
Method Details
-
withFlags
Sets the field access flags.- Parameters:
flags- the access flags, as a bit mask- Returns:
- this builder
-
withFlags
Sets the field access flags.- Parameters:
flags- the access flags, as a bit mask- Returns:
- this builder
-
original
Optional<FieldModel> original()Returns theFieldModelrepresenting the field being transformed, if this field builder represents the transformation of someFieldModel.- Returns:
- the
FieldModelrepresenting the field being transformed, if this field builder represents the transformation of someFieldModel
-