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

public abstract class BaseWriter extends Object implements AutoCloseable
Base class for all code writers.
  • Field Details

    • opts

      protected final Options opts
      The plugin options.
  • Constructor Details

    • BaseWriter

      protected BaseWriter(Writer writer, Options opts)
      Constructs a BaseWriter object.
      Parameters:
      writer - the java io writer to wrap.
      opts - the plugin options.
  • Method Details

    • write

      protected void write(String format, Object... args)
      Writes a formatted string without end-of-line.
      Parameters:
      format - the format.
      args - the arguments.
    • writeLine

      protected void writeLine(String format, Object... args)
      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

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException