Class ThreadLocalOptionsExtension
- java.lang.Object
-
- com.vladsch.flexmark.java.samples.ThreadLocalOptionsExtension
-
- All Implemented Interfaces:
RendererExtension
,Parser.ParserExtension
,Extension
public class ThreadLocalOptionsExtension extends java.lang.Object implements Parser.ParserExtension, RendererExtension
-
-
Field Summary
-
Fields inherited from interface com.vladsch.flexmark.util.misc.Extension
EMPTY_LIST
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ThreadLocalOptionsExtension
create()
void
extend(RendererBuilder rendererBuilder, java.lang.String rendererType)
Called to give each extension to register extension points that it containsvoid
extend(Parser.Builder parserBuilder)
This method is called on all extensions so that they can register their custom processorsvoid
parserOptions(MutableDataHolder options)
This method is called first on all extensions so that they can adjust the options that must be common to all extensions.void
rendererOptions(MutableDataHolder options)
This method is called first on all extensions so that they can adjust the options that must be common to all extensions.static void
setThreadOptions(DataSet perThreadOptions)
Set the per thread options for flexmark-java.
-
-
-
Method Detail
-
setThreadOptions
public static void setThreadOptions(DataSet perThreadOptions)
Set the per thread options for flexmark-java.Must be called from the thread to set options to be set for all flexmark-java code which uses this extension.
CAUTION: Do not try to make mutable data values shared. setAll() copies values of keys so immutable data valued keys: Boolean, String, Integer, enums, etc., are good to go as is.
For mutable values you will need to add extra code to address these or you will be hunting down overwrites of data from another thread.
- Parameters:
perThreadOptions
- data set of the per thread options
-
create
public static ThreadLocalOptionsExtension create()
-
extend
public void extend(Parser.Builder parserBuilder)
Description copied from interface:Parser.ParserExtension
This method is called on all extensions so that they can register their custom processors- Specified by:
extend
in interfaceParser.ParserExtension
- Parameters:
parserBuilder
- parser builder with which to register extensions- See Also:
Parser.Builder.customBlockParserFactory(CustomBlockParserFactory)
,Parser.Builder.customInlineParserExtensionFactory(InlineParserExtensionFactory)
,Parser.Builder.customInlineParserFactory(InlineParserFactory)
,Parser.Builder.customDelimiterProcessor(DelimiterProcessor)
,Parser.Builder.postProcessorFactory(PostProcessorFactory)
,Parser.Builder.paragraphPreProcessorFactory(ParagraphPreProcessorFactory)
,Parser.Builder.blockPreProcessorFactory(BlockPreProcessorFactory)
,Parser.Builder.linkRefProcessorFactory(LinkRefProcessorFactory)
,Parser.Builder.specialLeadInHandler(SpecialLeadInHandler)
-
parserOptions
public void parserOptions(MutableDataHolder options)
Description copied from interface:Parser.ParserExtension
This method is called first on all extensions so that they can adjust the options that must be common to all extensions.- Specified by:
parserOptions
in interfaceParser.ParserExtension
- Parameters:
options
- option set that will be used for the builder
-
rendererOptions
public void rendererOptions(@NotNull MutableDataHolder options)
Description copied from interface:RendererExtension
This method is called first on all extensions so that they can adjust the options that must be common to all extensions.- Specified by:
rendererOptions
in interfaceRendererExtension
- Parameters:
options
- option set that will be used for the builder
-
extend
public void extend(@NotNull RendererBuilder rendererBuilder, @NotNull java.lang.String rendererType)
Description copied from interface:RendererExtension
Called to give each extension to register extension points that it contains- Specified by:
extend
in interfaceRendererExtension
- Parameters:
rendererBuilder
- builder to call back for extension point registrationrendererType
- type of rendering being performed. For now "HTML", "JIRA" or "YOUTRACK"- See Also:
HtmlRenderer.Builder.attributeProviderFactory(AttributeProviderFactory)
,HtmlRenderer.Builder.linkResolverFactory(LinkResolverFactory)
,HtmlRenderer.Builder.htmlIdGeneratorFactory(HeaderIdGeneratorFactory)
-
-