Class AbstractConverter<T>

java.lang.Object
org.asciidoctor.converter.AbstractConverter<T>
Type Parameters:
T - The type of result this converter produces, e.g. String.
All Implemented Interfaces:
Converter<T>, OutputFormatWriter<T>, Logging, LogHandler
Direct Known Subclasses:
StringConverter

public abstract class AbstractConverter<T> extends Object implements Converter<T>, OutputFormatWriter<T>, Logging, LogHandler
An abstract base class for Java based converters. Instead of directly implementing Converter Java converters should extend this class.

For converters producing string output consider extending the StringConverter class.

  • Constructor Details

  • Method Details

    • getOptions

      public Map<String,Object> getOptions()
      Specified by:
      getOptions in interface Converter<T>
    • getBackend

      public String getBackend()
    • getOutfileSuffix

      public String getOutfileSuffix()
      Specified by:
      getOutfileSuffix in interface Converter<T>
      Returns:
      The file extension of the generated files.
    • setOutfileSuffix

      public void setOutfileSuffix(String outfilesuffix)
      Description copied from interface: Converter
      To change the extension of the generated file invoke this method in the constructor of the converter implementation. The default extension is .html.
      Specified by:
      setOutfileSuffix in interface Converter<T>
      Parameters:
      outfilesuffix - The file extension for the generated file, e.g. .txt
    • log

      public void log(LogRecord logRecord)
      Description copied from interface: LogHandler
      Process a log record. This method is called during conversion and will abort completely if an exception is thrown from within.
      Specified by:
      log in interface LogHandler
    • setLogHandler

      public void setLogHandler(LogHandler logHandler)
      Specified by:
      setLogHandler in interface Logging