Package org.asciidoctor.converter
Interface Converter<T>
-
- All Known Subinterfaces:
OutputFormatWriter<T>
- All Known Implementing Classes:
AbstractConverter,StringConverter
public interface Converter<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tconvert(ContentNode node, java.lang.String transform, java.util.Map<java.lang.Object,java.lang.Object> opts)Converts anContentNodeusing the specified transform along with additional options.java.util.Map<java.lang.String,java.lang.Object>getOptions()java.lang.StringgetOutfileSuffix()voidsetOutfileSuffix(java.lang.String outfilesuffix)To change the extension of the generated file invoke this method in the constructor of the converter implementation.
-
-
-
Method Detail
-
convert
T convert(ContentNode node, java.lang.String transform, java.util.Map<java.lang.Object,java.lang.Object> opts)
Converts anContentNodeusing the specified transform along with additional options. If a transform is not specified, implementations typically derive one from theContentNode.getNodeName()property.Implementations are free to decide how to carry out the conversion. In the case of the built-in converters, the tranform value is used to dispatch to a handler method. The TemplateConverter uses the value of the transform to select a template to render.
- Parameters:
node- The concrete instance of FlowNode to converttransform- An optional String transform that hints at which transformation should be applied to this node. If a transform is not specified, the transform is typically derived from the value of the node's node_name property. (optional, default: null)opts- An optional map of options that provide additional hints about how to convert the node. (optional, default: empty map)- Returns:
- the converted result
-
getOptions
java.util.Map<java.lang.String,java.lang.Object> getOptions()
-
setOutfileSuffix
void setOutfileSuffix(java.lang.String outfilesuffix)
To change the extension of the generated file invoke this method in the constructor of the converter implementation. The default extension is.html.- Parameters:
outfilesuffix- The file extension for the generated file, e.g..txt
-
getOutfileSuffix
java.lang.String getOutfileSuffix()
- Returns:
- The file extension of the generated files.
-
-