Package org.asciidoctor.converter
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 java.lang.Object implements Converter<T>, OutputFormatWriter<T>, Logging, LogHandler
An abstract base class for Java based converters. Instead of directly implementingConverterJava converters should extend this class.For converters producing string output consider extending the
StringConverterclass.
-
-
Constructor Summary
Constructors Constructor Description AbstractConverter(java.lang.String backend, java.util.Map<java.lang.String,java.lang.Object> opts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBackend()java.util.Map<java.lang.String,java.lang.Object>getOptions()java.lang.StringgetOutfileSuffix()voidlog(LogRecord logRecord)Process a log record.voidsetLogHandler(LogHandler logHandler)voidsetOutfileSuffix(java.lang.String outfilesuffix)To change the extension of the generated file invoke this method in the constructor of the converter implementation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.asciidoctor.converter.OutputFormatWriter
write
-
-
-
-
Method Detail
-
getOptions
public java.util.Map<java.lang.String,java.lang.Object> getOptions()
- Specified by:
getOptionsin interfaceConverter<T>
-
getBackend
public java.lang.String getBackend()
-
getOutfileSuffix
public java.lang.String getOutfileSuffix()
- Specified by:
getOutfileSuffixin interfaceConverter<T>- Returns:
- The file extension of the generated files.
-
setOutfileSuffix
public void setOutfileSuffix(java.lang.String outfilesuffix)
Description copied from interface:ConverterTo change the extension of the generated file invoke this method in the constructor of the converter implementation. The default extension is.html.- Specified by:
setOutfileSuffixin interfaceConverter<T>- Parameters:
outfilesuffix- The file extension for the generated file, e.g..txt
-
log
public void log(LogRecord logRecord)
Description copied from interface:LogHandlerProcess a log record. This method is called during conversion and will abort completely if an exception is thrown from within.- Specified by:
login interfaceLogHandler
-
setLogHandler
public void setLogHandler(LogHandler logHandler)
- Specified by:
setLogHandlerin interfaceLogging
-
-