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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
private final HashMap
<String, StringWriter> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all source files in thisOutputManager
and reset the initial package name.createOutput
(String name) Create a new output destination based on a name.Get aCharSequence
which represents the source file.Get aMap
of all source files.void
setPackageName
(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, wait
Methods inherited from interface org.agrona.generation.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:
createOutput
in interfaceOutputManager
- Parameters:
name
- of the given output.- Returns:
- A
Writer
to which the code generation should be output.
-
setPackageName
Set the package name to be used for source files.- Specified by:
setPackageName
in interfaceDynamicPackageOutputManager
- Parameters:
packageName
- to be used for source files.
-
getSource
Get aCharSequence
which represents the source file.- Parameters:
name
- of the source file.- Returns:
CharSequence
which represents the source file.
-
getSources
Get aMap
of all source files.- Returns:
- a
Map
of all source files.
-
clear
public void clear()Clear all source files in thisOutputManager
and reset the initial package name.
-