Class BaseWriter
java.lang.Object
io.github.torand.openapi2java.writers.BaseWriter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
JavaEnumWriter,JavaOpenApiDefWriter,JavaPojoWriter,JavaResourceWriter,KotlinEnumWriter,KotlinOpenApiDefWriter,KotlinPojoWriter,KotlinResourceWriter
Base class for all code writers.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseWriter(Writer writer, Options opts) Constructs aBaseWriterobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidWrites a formatted string without end-of-line.protected voidwriteIndent(int levels) Writes specified number of indent levels.protected voidWrites a formatted string with end-of-line.protected voidWrites end-of-line.
-
Field Details
-
opts
The plugin options.
-
-
Constructor Details
-
BaseWriter
Constructs aBaseWriterobject.- Parameters:
writer- the java io writer to wrap.opts- the plugin options.
-
-
Method Details
-
write
Writes a formatted string without end-of-line.- Parameters:
format- the format.args- the arguments.
-
writeLine
Writes a formatted string with end-of-line.- Parameters:
format- the format.args- the arguments.
-
writeNewLine
protected void writeNewLine()Writes end-of-line. -
writeIndent
protected void writeIndent(int levels) Writes specified number of indent levels.- Parameters:
levels- the number of indent levels.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-