Class PluginFragmentTransformer<T>
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.transformers.PluginFragmentTransformer<T>
-
- All Implemented Interfaces:
FragmentTransformer
public class PluginFragmentTransformer<T> extends Object implements FragmentTransformer
An transformer class used to access fragment transformers which are defined in plugins.
This is a solution to access fragment transformers that are only available at runtime.
This will respect the weight and chain name of a transformer module descriptor. This also allows to pass in difference marker
-
-
Constructor Summary
Constructors Constructor Description PluginFragmentTransformer(com.atlassian.plugin.PluginAccessor pluginAccessor, String transformerChainName, Class<T> markerClass)
A transformer in Confluence core which could reuse a logic from plugin's transformer.PluginFragmentTransformer(com.atlassian.plugin.PluginAccessor pluginAccessor, String transformerChainName, Class<T> markerClass, List<FragmentTransformer> defaultFragmentTransformerList)
A transformer in Confluence core which could reuse a logic from plugin's transformer.PluginFragmentTransformer(com.atlassian.plugin.PluginAccessor pluginAccessor, String transformerChainName, Class<T> markerClass, List<FragmentTransformer> defaultFragmentTransformerList, boolean isLazyInitialPluginTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<FragmentTransformer>
getFragmentTransformers()
boolean
handles(StartElement startElementEvent, ConversionContext conversionContext)
Streamable
transform(XMLEventReader reader, FragmentTransformer mainFragmentTransformer, ConversionContext conversionContext)
-
-
-
Constructor Detail
-
PluginFragmentTransformer
public PluginFragmentTransformer(com.atlassian.plugin.PluginAccessor pluginAccessor, String transformerChainName, Class<T> markerClass)
A transformer in Confluence core which could reuse a logic from plugin's transformer. This constructor will be used by daisy diff which required to retrieve Plugin's Transformer on the fly- Parameters:
pluginAccessor
- used to access plugin's transformertransformerChainName
- a name which identify which flow transformer is supported (ex: storageToView) This would match with the one defined in pluginmarkerClass
- a marker which use to filter out plugin's transformer
-
PluginFragmentTransformer
public PluginFragmentTransformer(com.atlassian.plugin.PluginAccessor pluginAccessor, String transformerChainName, Class<T> markerClass, List<FragmentTransformer> defaultFragmentTransformerList)
A transformer in Confluence core which could reuse a logic from plugin's transformer. This constructor will be used for Space exporting which require to load all plugin's transformer eagerly- Parameters:
pluginAccessor
- used to access plugin's transformertransformerChainName
- a name which identify which flow transformer is supported (ex: storageToView) This would match with the one defined in pluginmarkerClass
- a marker which use to filter out plugin's transformerdefaultFragmentTransformerList
- list of default FragmentTransformer might come from Confluence Core. Note: caller must make sure that transformer are stateless
-
PluginFragmentTransformer
public PluginFragmentTransformer(com.atlassian.plugin.PluginAccessor pluginAccessor, String transformerChainName, Class<T> markerClass, List<FragmentTransformer> defaultFragmentTransformerList, boolean isLazyInitialPluginTransformer)
-
-
Method Detail
-
handles
public boolean handles(StartElement startElementEvent, ConversionContext conversionContext)
- Specified by:
handles
in interfaceFragmentTransformer
-
getFragmentTransformers
public List<FragmentTransformer> getFragmentTransformers()
-
transform
public Streamable transform(XMLEventReader reader, FragmentTransformer mainFragmentTransformer, ConversionContext conversionContext) throws XhtmlException
- Specified by:
transform
in interfaceFragmentTransformer
- Throws:
XhtmlException
-
-