Class CodeWriter
java.lang.Object
java.io.Writer
java.io.StringWriter
software.amazon.awssdk.codegen.lite.emitters.CodeWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
Formats the generated code and write it to the underlying file. The caller should call the flush
method to write the contents to the file. This class is intended to be used only by the code
generation system and is not to be used for public use.
-
Constructor Summary
ConstructorDescriptionCodeWriter
(String dir, String file) Constructor to use for .java files.CodeWriter
(String dir, String file, String fileNameSuffix) Constructor to use for custom file suffixes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
This method is expected to be called only once during the code generation process after the template processing is done.
-
Constructor Details
-
CodeWriter
Constructor to use for .java files.- Parameters:
dir
- output directory where the file is to be created.file
- name of the file without .java suffix.
-
CodeWriter
Constructor to use for custom file suffixes.- Parameters:
dir
- output directory where the file is to be created.file
- name of the file excluding suffix.fileNameSuffix
- suffix to be appended at the end of file name.
-
-
Method Details
-
flush
public void flush()This method is expected to be called only once during the code generation process after the template processing is done.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classStringWriter
-