Class StringWriterOutputManager

java.lang.Object
org.agrona.generation.StringWriterOutputManager
All Implemented Interfaces:
DynamicPackageOutputManager, OutputManager

public class StringWriterOutputManager extends Object implements DynamicPackageOutputManager
An OutputManager which can store source files as StringWriter buy source file name.
  • Field Details

  • Constructor Details

    • StringWriterOutputManager

      public StringWriterOutputManager()
  • Method Details

    • createOutput

      public Writer createOutput(String name)
      Create a new output destination based on a name. The user is responsible for calling Writer.close().
      Specified by:
      createOutput in interface OutputManager
      Parameters:
      name - of the given output.
      Returns:
      A Writer to which the code generation should be output.
    • setPackageName

      public void setPackageName(String packageName)
      Set the package name to be used for source files.
      Specified by:
      setPackageName in interface DynamicPackageOutputManager
      Parameters:
      packageName - to be used for source files.
    • getSource

      public CharSequence getSource(String name)
      Get a CharSequence which represents the source file.
      Parameters:
      name - of the source file.
      Returns:
      CharSequence which represents the source file.
    • getSources

      public Map<String,CharSequence> getSources()
      Get a Map of all source files.
      Returns:
      a Map of all source files.
    • clear

      public void clear()
      Clear all source files in this OutputManager and reset the initial package name.