java.lang.Object
org.glavo.classfile.impl.AbstractDirectBuilder<MethodModel>
org.glavo.classfile.impl.DirectMethodBuilder
- All Implemented Interfaces:
Consumer<MethodElement>,ClassFileBuilder<MethodElement,,MethodBuilder> ClassFileElement,MethodInfo,TerminalMethodBuilder,MethodBuilder,WritableElement<MethodModel>
public final class DirectMethodBuilder
extends AbstractDirectBuilder<MethodModel>
implements TerminalMethodBuilder, WritableElement<MethodModel>, MethodInfo
-
Field Summary
Fields inherited from class org.glavo.classfile.impl.AbstractDirectBuilder
attributes, constantPool, context, original -
Constructor Summary
ConstructorsConstructorDescriptionDirectMethodBuilder(SplitConstantPool constantPool, ClassFileImpl context, Utf8Entry nameInfo, Utf8Entry typeInfo, int flags, MethodModel original) -
Method Summary
Modifier and TypeMethodDescriptionbufferedCodeBuilder(CodeModel original) intintparameterSlot(int paramNo) run(Consumer<? super MethodBuilder> handler) transformCode(CodeModel code, CodeTransform transform) Build the method body for this method by transforming the body of another method.with(MethodElement element) Integrate theClassFileElementinto the entity being built.withCode(Consumer<? super CodeBuilder> handler) Build the method body for this method.voidWrites the element to the specified writerMethods inherited from class org.glavo.classfile.impl.AbstractDirectBuilder
constantPool, original, setOriginal, writeAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glavo.classfile.ClassFileBuilder
accept, canWriteDirect, constantPool, transformMethods inherited from interface org.glavo.classfile.MethodBuilder
original, withFlags, withFlagsMethods inherited from interface org.glavo.classfile.impl.MethodInfo
receiverSlot
-
Constructor Details
-
DirectMethodBuilder
public DirectMethodBuilder(SplitConstantPool constantPool, ClassFileImpl context, Utf8Entry nameInfo, Utf8Entry typeInfo, int flags, MethodModel original)
-
-
Method Details
-
methodName
- Specified by:
methodNamein interfaceMethodInfo
-
methodType
- Specified by:
methodTypein interfaceMethodInfo
-
methodTypeSymbol
- Specified by:
methodTypeSymbolin interfaceMethodInfo
-
methodFlags
public int methodFlags()- Specified by:
methodFlagsin interfaceMethodInfo
-
parameterSlot
public int parameterSlot(int paramNo) - Specified by:
parameterSlotin interfaceMethodInfo
-
bufferedCodeBuilder
- Specified by:
bufferedCodeBuilderin interfaceTerminalMethodBuilder
-
with
Description copied from interface:ClassFileBuilderIntegrate theClassFileElementinto the entity being built.- Specified by:
within interfaceClassFileBuilder<MethodElement,MethodBuilder> - Parameters:
element- the element- Returns:
- this builder
-
withCode
Description copied from interface:MethodBuilderBuild the method body for this method.- Specified by:
withCodein interfaceMethodBuilder- Parameters:
handler- a handler receiving aCodeBuilder- Returns:
- this builder
-
transformCode
Description copied from interface:MethodBuilderBuild the method body for this method by transforming the body of another method.- Specified by:
transformCodein interfaceMethodBuilder- Parameters:
code- the method body to be transformedtransform- the transform to apply to the method body- Returns:
- this builder
-
run
-
writeTo
Description copied from interface:WritableElementWrites the element to the specified writer- Specified by:
writeToin interfaceWritableElement<MethodModel>- Parameters:
b- the writer
-