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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate final HashMap<String, StringWriter> -
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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface OutputManager
withOutput
-
Field Details
-
packageName
-
initialPackageName
-
sourceFileByName
-
-
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
-
clear
public void clear()Clear all source files in thisOutputManagerand reset the initial package name.
-