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 implementingConverter
Java converters should extend this class.For converters producing string output consider extending the
StringConverter
class.
-
-
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.String
getBackend()
java.util.Map<java.lang.String,java.lang.Object>
getOptions()
java.lang.String
getOutfileSuffix()
void
log(LogRecord logRecord)
Process a log record.void
setLogHandler(LogHandler logHandler)
void
setOutfileSuffix(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:
getOptions
in interfaceConverter<T>
-
getBackend
public java.lang.String getBackend()
-
getOutfileSuffix
public java.lang.String getOutfileSuffix()
- Specified by:
getOutfileSuffix
in interfaceConverter<T>
- Returns:
- The file extension of the generated files.
-
setOutfileSuffix
public void setOutfileSuffix(java.lang.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 interfaceConverter<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 interfaceLogHandler
-
setLogHandler
public void setLogHandler(LogHandler logHandler)
- Specified by:
setLogHandler
in interfaceLogging
-
-