Package org.agrona.generation
Interface OutputManager
-
- All Known Subinterfaces:
DynamicPackageOutputManager
- All Known Implementing Classes:
PackageOutputManager
,StringWriterOutputManager
public interface OutputManager
Abstraction that manages the destination of generated output.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.io.Writer
createOutput(java.lang.String name)
Create a new output destination based on a name.default void
withOutput(java.lang.String name, ResourceConsumer<java.io.Writer> resourceConsumer)
Create named output and callResourceConsumer.accept(Object)
.
-
-
-
Method Detail
-
createOutput
java.io.Writer createOutput(java.lang.String name) throws java.io.IOException
Create a new output destination based on a name. The user is responsible for callingWriter.close()
.- Parameters:
name
- of the given output.- Returns:
- A
Writer
to which the code generation should be output. - Throws:
java.io.IOException
- if an error occurs during output.
-
withOutput
default void withOutput(java.lang.String name, ResourceConsumer<java.io.Writer> resourceConsumer)
Create named output and callResourceConsumer.accept(Object)
.- Parameters:
name
- name of the output to create.resourceConsumer
- to be called.
-
-