Package org.agrona.generation
Class StringWriterOutputManager
java.lang.Object
org.agrona.generation.StringWriterOutputManager
- All Implemented Interfaces:
DynamicPackageOutputManager,OutputManager
An
OutputManager which can store source files as StringWriter buy source file name.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all source files in thisOutputManagerand reset the initial package name.createOutput(String name) Create a new output destination based on a name.Get aCharSequencewhich represents the source file.Get aMapof all source files.voidsetPackageName(String packageName) Set the package name to be used for source files.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.agrona.generation.OutputManager
withOutput
-
Constructor Details
-
StringWriterOutputManager
public StringWriterOutputManager()Create a new instance.
-
-
Method Details
-
createOutput
Create a new output destination based on a name. The user is responsible for callingWriter.close().- Specified by:
createOutputin interfaceOutputManager- Parameters:
name- of the given output.- Returns:
- A
Writerto which the code generation should be output.
-
setPackageName
Set the package name to be used for source files.- Specified by:
setPackageNamein interfaceDynamicPackageOutputManager- Parameters:
packageName- to be used for source files.
-
getSource
Get aCharSequencewhich represents the source file.- Parameters:
name- of the source file.- Returns:
CharSequencewhich represents the source file.
-
getSources
Get aMapof all source files.- Returns:
- a
Mapof all source files.
-
clear
public void clear()Clear all source files in thisOutputManagerand reset the initial package name.
-