Interface OutputManager

All Known Subinterfaces:
DynamicPackageOutputManager
All Known Implementing Classes:
PackageOutputManager, StringWriterOutputManager

public interface OutputManager
Abstraction that manages the destination of generated output.
  • Method Details

    • createOutput

      Writer createOutput(String name) throws IOException
      Create a new output destination based on a name. The user is responsible for calling Writer.close().
      Parameters:
      name - of the given output.
      Returns:
      A Writer to which the code generation should be output.
      Throws:
      IOException - if an error occurs during output.
    • withOutput

      default void withOutput(String name, ResourceConsumer<Writer> resourceConsumer)
      Create named output and call ResourceConsumer.accept(Object).
      Parameters:
      name - name of the output to create.
      resourceConsumer - to be called.