Class Serializer

    • Constructor Detail

      • Serializer

        public Serializer​(Node node,
                          ExecutionContext executionContext)
        Public constructor.
        Parameters:
        node - Node to be serialized.
        executionContext - Target device context.
    • Method Detail

      • serialize

        public void serialize​(Writer writer)
                       throws IOException
        Serialise the document to the supplied output writer instance.

        Adds the DOCTYPE decl if one defined in the Content Delivery Configuration.

        If the node is a Document (or DocumentFragment) node the whole node is serialised. Otherwise, only the node child elements are serialised i.e. the node itself is skipped.

        Parameters:
        writer - Output writer.
        Throws:
        IOException - Unable to write to output writer.
      • recursiveDOMWrite

        public static void recursiveDOMWrite​(Element element,
                                             Writer writer)
        Recursively write the DOM tree to the supplied writer.
        Parameters:
        element - Element to write.
        writer - Writer to use.