Top Inners Fields Constructors Methods
jdk.internal.classfile.impl

public final Class BufferedMethodBuilder

extends Object
implements TerminalMethodBuilder, MethodInfo
Class Inheritance
All Implemented Interfaces
jdk.internal.classfile.impl.MethodInfo, jdk.internal.classfile.impl.TerminalMethodBuilder, java.lang.classfile.MethodBuilder, java.lang.classfile.ClassFileBuilder, java.util.function.Consumer
Imports
java.lang.constant.MethodTypeDesc, java.util.ArrayList, .List, .Optional, java.util.function.Consumer, java.lang.classfile.AccessFlags, .BufWriter, .ClassModel, .CodeBuilder, .CodeModel, .CodeTransform, .MethodBuilder, .MethodElement, .MethodModel, java.lang.classfile.constantpool.ConstantPoolBuilder, .Utf8Entry

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private final SplitConstantPool
private final ClassFileImpl
private final Utf8Entry
private final List<MethodElement>
private AccessFlags
pack-priv MethodTypeDesc
private final Utf8Entry
private final MethodModel
private int[]

Constructor Summary

AccessConstructor and Description
public
BufferedMethodBuilder(SplitConstantPool constantPool, ClassFileImpl context, Utf8Entry nameInfo, Utf8Entry typeInfo, MethodModel original)

Method Summary

Modifier and TypeMethod and Description
public BufferedCodeBuilder
public ConstantPoolBuilder
constantPool()

Implements java.lang.classfile.ClassFileBuilder.constantPool.

Returns the constant pool builder associated with this builder.

public int
public Utf8Entry
public Utf8Entry
public MethodTypeDesc
public Optional<MethodModel>
original()

Implements java.lang.classfile.MethodBuilder.original.

Returns the MethodModel representing the method being transformed, if this method builder represents the transformation of some MethodModel.

public int
public BufferedMethodBuilder
run(Consumer<? super MethodBuilder> handler)

public MethodModel
public MethodBuilder
transformCode(CodeModel
the method body to be transformed
code
,
CodeTransform
the transform to apply to the method body
transform
)

Implements java.lang.classfile.MethodBuilder.transformCode.

Build the method body for this method by transforming the body of another method.

public MethodBuilder
with(MethodElement
the element
element
)

Implements java.lang.classfile.ClassFileBuilder.with.

Integrate the ClassFileElement into the entity being built.

public MethodBuilder
withCode(Consumer<? super CodeBuilder>
a handler receiving a CodeBuilder
handler
)

Implements java.lang.classfile.MethodBuilder.withCode.

Build the method body for this method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constantPoolback to summary
private final SplitConstantPool constantPool
contextback to summary
private final ClassFileImpl context
descback to summary
private final Utf8Entry desc
elementsback to summary
private final List<MethodElement> elements
flagsback to summary
private AccessFlags flags
mDescback to summary
pack-priv MethodTypeDesc mDesc
nameback to summary
private final Utf8Entry name
originalback to summary
private final MethodModel original
parameterSlotsback to summary
private int[] parameterSlots

Constructor Detail

BufferedMethodBuilderback to summary
public BufferedMethodBuilder(SplitConstantPool constantPool, ClassFileImpl context, Utf8Entry nameInfo, Utf8Entry typeInfo, MethodModel original)

Method Detail

bufferedCodeBuilderback to summary
public BufferedCodeBuilder bufferedCodeBuilder(CodeModel original)

Implements jdk.internal.classfile.impl.TerminalMethodBuilder.bufferedCodeBuilder.

Annotations
@Override
constantPoolback to summary
public ConstantPoolBuilder constantPool()

Implements java.lang.classfile.ClassFileBuilder.constantPool.

Doc from java.lang.classfile.ClassFileBuilder.constantPool.

Returns the constant pool builder associated with this builder.

Returns:ConstantPoolBuilder

the constant pool builder associated with this builder

Annotations
@Override
methodFlagsback to summary
public int methodFlags()

Implements jdk.internal.classfile.impl.MethodInfo.methodFlags.

Annotations
@Override
methodNameback to summary
public Utf8Entry methodName()

Implements jdk.internal.classfile.impl.MethodInfo.methodName.

Annotations
@Override
methodTypeback to summary
public Utf8Entry methodType()

Implements jdk.internal.classfile.impl.MethodInfo.methodType.

Annotations
@Override
methodTypeSymbolback to summary
public MethodTypeDesc methodTypeSymbol()

Implements jdk.internal.classfile.impl.MethodInfo.methodTypeSymbol.

Annotations
@Override
originalback to summary
public Optional<MethodModel> original()

Implements java.lang.classfile.MethodBuilder.original.

Doc from java.lang.classfile.MethodBuilder.original.

Returns the MethodModel representing the method being transformed, if this method builder represents the transformation of some MethodModel.

Returns:Optional<MethodModel>

the MethodModel representing the method being transformed, if this method builder represents the transformation of some MethodModel

Annotations
@Override
parameterSlotback to summary
public int parameterSlot(int paramNo)

Implements jdk.internal.classfile.impl.MethodInfo.parameterSlot.

Annotations
@Override
runback to summary
public BufferedMethodBuilder run(Consumer<? super MethodBuilder> handler)
toModelback to summary
public MethodModel toModel()
transformCodeback to summary
public MethodBuilder transformCode(CodeModel code, CodeTransform transform)

Implements java.lang.classfile.MethodBuilder.transformCode.

Doc from java.lang.classfile.MethodBuilder.transformCode.

Build the method body for this method by transforming the body of another method.

Parameters
code:CodeModel

the method body to be transformed

transform:CodeTransform

the transform to apply to the method body

Returns:MethodBuilder

this builder

Annotations
@Override
withback to summary
public MethodBuilder with(MethodElement element)

Implements java.lang.classfile.ClassFileBuilder.with.

Doc from java.lang.classfile.ClassFileBuilder.with.

Integrate the ClassFileElement into the entity being built.

Parameters
element:MethodElement

the element

Returns:MethodBuilder

this builder

Annotations
@Override
withCodeback to summary
public MethodBuilder withCode(Consumer<? super CodeBuilder> handler)

Implements java.lang.classfile.MethodBuilder.withCode.

Doc from java.lang.classfile.MethodBuilder.withCode.

Build the method body for this method.

Parameters
handler:Consumer<? super CodeBuilder>

a handler receiving a CodeBuilder

Returns:MethodBuilder

this builder

Annotations
@Override
jdk.internal.classfile.impl back to summary

public final Class BufferedMethodBuilder.Model

extends AbstractUnboundModel<MethodElement>
implements MethodModel, MethodInfo
Class Inheritance
All Implemented Interfaces
jdk.internal.classfile.impl.MethodInfo, java.lang.classfile.MethodModel, java.lang.classfile.ClassElement, java.lang.classfile.ClassFileElement, java.lang.classfile.AttributedElement, java.lang.classfile.CompoundElement, java.lang.Iterable, java.lang.classfile.WritableElement

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Optional<CodeModel>
code()

Implements java.lang.classfile.MethodModel.code.

Returns the body of this method, if there is one.

public AccessFlags
flags()

Implements java.lang.classfile.MethodModel.flags.

Returns the access flags.

public int
public Utf8Entry
public Utf8Entry
public MethodTypeDesc
methodTypeSymbol()

Overrides default java.lang.classfile.MethodModel.methodTypeSymbol.

Implements jdk.internal.classfile.impl.MethodInfo.methodTypeSymbol.

Returns the method descriptor of this method, as a symbolic descriptor.

public int
public Optional<ClassModel>
parent()

Implements java.lang.classfile.MethodModel.parent.

Returns the class model this method is a member of, if known.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
public void
writeTo(BufWriter
the writer
buf
)

Implements java.lang.classfile.WritableElement.writeTo.

Writes the element to the specified writer

Inherited from jdk.internal.classfile.impl.AbstractUnboundModel:
attributeselementListelementStreamforEachElement

Constructor Detail

Modelback to summary
public Model()

Method Detail

codeback to summary
public Optional<CodeModel> code()

Implements java.lang.classfile.MethodModel.code.

Doc from java.lang.classfile.MethodModel.code.

Returns the body of this method, if there is one.

Returns:Optional<CodeModel>

the body of this method, if there is one

Annotations
@Override
flagsback to summary
public AccessFlags flags()

Implements java.lang.classfile.MethodModel.flags.

Doc from java.lang.classfile.MethodModel.flags.

Returns the access flags.

Returns:AccessFlags

the access flags

Annotations
@Override
methodFlagsback to summary
public int methodFlags()

Implements jdk.internal.classfile.impl.MethodInfo.methodFlags.

Annotations
@Override
methodNameback to summary
public Utf8Entry methodName()

Implements java.lang.classfile.MethodModel.methodName, jdk.internal.classfile.impl.MethodInfo.methodName.

Doc from java.lang.classfile.MethodModel.methodName.

Returns the name of this method.

Returns:Utf8Entry

the name of this method

Annotations
@Override
methodTypeback to summary
public Utf8Entry methodType()

Implements java.lang.classfile.MethodModel.methodType, jdk.internal.classfile.impl.MethodInfo.methodType.

Doc from java.lang.classfile.MethodModel.methodType.

Returns the method descriptor of this method.

Returns:Utf8Entry

the method descriptor of this method

Annotations
@Override
methodTypeSymbolback to summary
public MethodTypeDesc methodTypeSymbol()

Overrides default java.lang.classfile.MethodModel.methodTypeSymbol.

Implements jdk.internal.classfile.impl.MethodInfo.methodTypeSymbol.

Doc from java.lang.classfile.MethodModel.methodTypeSymbol.

Returns the method descriptor of this method, as a symbolic descriptor.

Returns:MethodTypeDesc

the method descriptor of this method, as a symbolic descriptor

Annotations
@Override
parameterSlotback to summary
public int parameterSlot(int paramNo)

Implements jdk.internal.classfile.impl.MethodInfo.parameterSlot.

Annotations
@Override
parentback to summary
public Optional<ClassModel> parent()

Implements java.lang.classfile.MethodModel.parent.

Doc from java.lang.classfile.MethodModel.parent.

Returns the class model this method is a member of, if known.

Returns:Optional<ClassModel>

the class model this method is a member of, if known

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
writeToback to summary
public void writeTo(DirectClassBuilder builder)

Overrides jdk.internal.classfile.impl.AbstractElement.writeTo.

Annotations
@Override
writeToback to summary
public void writeTo(BufWriter buf)

Implements java.lang.classfile.WritableElement.writeTo.

Doc from java.lang.classfile.WritableElement.writeTo.

Writes the element to the specified writer

Parameters
buf:BufWriter

the writer

Annotations
@Override