Package org.docx4j.convert.out.common
Class AbstractWriterRegistry
java.lang.Object
org.docx4j.convert.out.common.AbstractWriterRegistry
There is one instance of the WriterRegistry for each output type (eg. FO, HTML).
The WriterRegistry manages the Writers and
then converts dom nodes using the registered @see org.docx4j.convert.out.common.Writer
Writer classes on the other hand are customized, they are to be registered by the caller, and
they are singletons. Registration uses the node name as key value.
Here is an example how you might want to call Converter from an xslt file
<xsl:template match="foo">
<xsl:variable name="me" select="."/>
<xsl:variable name="children">
<xsl:apply-templates/>
</xsl:variable>
<xsl:copy-of select="java:org.docx4j.convert.out.Converter.toNode($me, $children)"/>
...
This assumes that a writer is registered for "foo".- Author:
- Adam Schmideg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFactory Method to create the required Transform States for the contextprotected abstract voidvoidregisterWriter(Writer converter) toNode(AbstractWmlConversionContext context, Object unmarshalledNode, String modelID, Node content, Document doc) This method is called from the converters that don't use XSLTtoNode(AbstractWmlConversionContext context, Node node, NodeList childResults) This method is called from the converters with XSL-Transformations
-
Constructor Details
-
AbstractWriterRegistry
public AbstractWriterRegistry()
-
-
Method Details
-
registerDefaultWriterInstances
protected abstract void registerDefaultWriterInstances() -
registerWriter
-
createTransformStates
Factory Method to create the required Transform States for the context- Returns:
-
toNode
This method is called from the converters with XSL-Transformations- Parameters:
node-childResults- the already transformed node (element) contentdoc-- Returns:
-
toNode
public Node toNode(AbstractWmlConversionContext context, Object unmarshalledNode, String modelID, Node content, Document doc) This method is called from the converters that don't use XSLT- Parameters:
node-childResults- the already transformed node (element) contentdoc-- Returns:
-