Class AbstractWriterRegistry

java.lang.Object
org.docx4j.convert.out.common.AbstractWriterRegistry

public abstract class AbstractWriterRegistry
extends java.lang.Object
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

 
   
   
      
   
   
   ...
 
This assumes that a writer is registered for "foo".
Author:
Adam Schmideg
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractWriterRegistry()  
  • Method Summary

    Modifier and Type Method Description
    java.util.Map<java.lang.String,​Writer.TransformState> createTransformStates()
    Factory Method to create the required Transform States for the context
    protected abstract void registerDefaultWriterInstances()  
    void registerWriter​(Writer converter)  
    org.w3c.dom.Node toNode​(AbstractWmlConversionContext context, java.lang.Object unmarshalledNode, java.lang.String modelID, org.w3c.dom.Node content, org.w3c.dom.Document doc)
    This method is called from the converters that don't use XSLT
    org.w3c.dom.Node toNode​(AbstractWmlConversionContext context, org.w3c.dom.Node node, org.w3c.dom.NodeList childResults)
    This method is called from the converters with XSL-Transformations

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • registerDefaultWriterInstances

      protected abstract void registerDefaultWriterInstances()
    • registerWriter

      public void registerWriter​(Writer converter)
    • createTransformStates

      public java.util.Map<java.lang.String,​Writer.TransformState> createTransformStates()
      Factory Method to create the required Transform States for the context
      Returns:
    • toNode

      public org.w3c.dom.Node toNode​(AbstractWmlConversionContext context, org.w3c.dom.Node node, org.w3c.dom.NodeList childResults)
      This method is called from the converters with XSL-Transformations
      Parameters:
      node -
      childResults - the already transformed node (element) content
      doc -
      Returns:
    • toNode

      public org.w3c.dom.Node toNode​(AbstractWmlConversionContext context, java.lang.Object unmarshalledNode, java.lang.String modelID, org.w3c.dom.Node content, org.w3c.dom.Document doc)
      This method is called from the converters that don't use XSLT
      Parameters:
      node -
      childResults - the already transformed node (element) content
      doc -
      Returns: