Interface Gizmo


public sealed interface Gizmo
A simplified class file writer.
  • Method Details

    • create

      static Gizmo create(ClassOutput outputHandler)
      Returns a new Gizmo which outputs to the given handler by default.
      Parameters:
      outputHandler - the output handler (must not be null)
      Returns:
      a new Gizmo which outputs to the given handler by default
    • withOutput

      Gizmo withOutput(ClassOutput outputHandler)
      Returns a Gizmo instance which uses the given output handler.
      Parameters:
      outputHandler - the output handler (must not be null)
      Returns:
      a Gizmo instance which uses the given output handler
    • withDefaultModifiers

      Gizmo withDefaultModifiers(Consumer<ModifierConfigurator> builder)
      Returns a Gizmo instance which uses the default modifiers configured by the given configurator.
      Parameters:
      builder - the builder for the defaults (must not be null)
      Returns:
      a Gizmo instance which uses the default modifiers configured by the given configurator
    • class_

      default ClassDesc class_(String name, Consumer<ClassCreator> builder)
      Add a new class.
      Parameters:
      name - the fully qualified (dot-separated) binary class name (must not be null)
      builder - the builder for the class (must not be null)
      Returns:
      the descriptor of the created class (not null)
    • class_

      ClassDesc class_(ClassDesc desc, Consumer<ClassCreator> builder)
      Add a new class.
      Parameters:
      desc - the class descriptor (must not be null)
      builder - the builder for the class (must not be null)
      Returns:
      the descriptor given for desc
    • interface_

      default ClassDesc interface_(String name, Consumer<InterfaceCreator> builder)
      Add a new interface.
      Parameters:
      name - the fully qualified (dot-separated) binary class name
      builder - the builder for the interface (must not be null)
      Returns:
      the descriptor of the created interface (not null)
    • interface_

      ClassDesc interface_(ClassDesc desc, Consumer<InterfaceCreator> builder)
      Add a new interface.
      Parameters:
      desc - the class descriptor (must not be null)
      builder - the builder for the class (must not be null)
      Returns:
      the descriptor given for desc