Class CodeWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.StringWriter
-
- software.amazon.awssdk.codegen.emitters.CodeWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class CodeWriter extends StringWriter
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
Constructors Constructor Description CodeWriter(String dir, String file)
Constructor to use for .java files.CodeWriter(String dir, String file, boolean disableFormatter)
CodeWriter(String dir, String file, String fileNameSuffix, boolean disableFormatter)
Constructor to use for custom file suffixes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
This method is expected to be called only once during the code generation process after the template processing is done.
-
-
-
Constructor Detail
-
CodeWriter
public CodeWriter(String dir, String file)
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
public CodeWriter(String dir, String file, String fileNameSuffix, boolean disableFormatter)
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 Detail
-
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
-
-