java.lang.Object
io.github.sugarcubes.cloner.bytecode.MethodSpec

public final class MethodSpec extends Object
Method of a generated class.
  • Constructor Details

    • MethodSpec

      public MethodSpec(int access, String name, String descriptor, Consumer<CodeEmitter> body)
      Creates the method.
      Parameters:
      access - access flags (Modifier values)
      name - method name
      descriptor - method descriptor
      body - emits the instructions
  • Method Details

    • getAccess

      public int getAccess()
      Returns the access flags.
      Returns:
      access flags
    • getName

      public String getName()
      Returns the method name.
      Returns:
      method name
    • getDescriptor

      public String getDescriptor()
      Returns the method descriptor.
      Returns:
      method descriptor
    • emit

      public void emit(CodeEmitter code)
      Emits the instructions of the method.
      Parameters:
      code - emitter of the backend