Class DefaultDOMSerializerVisitor

    • Field Detail

      • closeEmptyElements

        protected Boolean closeEmptyElements
      • rewriteEntities

        protected Boolean rewriteEntities
    • Constructor Detail

      • DefaultDOMSerializerVisitor

        public DefaultDOMSerializerVisitor()
    • Method Detail

      • setCloseEmptyElements

        @Inject
        public void setCloseEmptyElements​(@Named("close.empty.elements")
                                          Optional<Boolean> closeEmptyElements)
      • setRewriteEntities

        @Inject
        public void setRewriteEntities​(@Named("entities.rewrite")
                                       Optional<Boolean> rewriteEntities)
      • postConstruct

        @PostConstruct
        public void postConstruct()
      • writeStartElement

        public void writeStartElement​(Element element,
                                      Writer writer,
                                      ExecutionContext executionContext)
                               throws IOException
        Description copied from interface: SerializerVisitor
        Write the element start portion; the element name and it's attributes.

        EG: <a href="http://www.x.com">

        Specified by:
        writeStartElement in interface SerializerVisitor
        Parameters:
        element - The element start to write.
        writer - The writer to be written to.
        executionContext - ExecutionContext instance for the delivery context.
        Throws:
        IOException - Exception writing output.
      • writeEndElement

        public void writeEndElement​(Element element,
                                    Writer writer,
                                    ExecutionContext executionContext)
                             throws IOException
        Description copied from interface: SerializerVisitor
        Write the element end portion; close the element.

        EG: </a>

        Specified by:
        writeEndElement in interface SerializerVisitor
        Parameters:
        element - The element end to write.
        writer - The writer to be written to.
        executionContext - ExecutionContext instance for the delivery context.
        Throws:
        IOException - Exception writing output.
      • writeElementNode

        public void writeElementNode​(Node node,
                                     Writer writer,
                                     ExecutionContext executionContext)
                              throws IOException
        Description copied from interface: SerializerVisitor
        Write element Node object.

        Called to write DOM types not covered by the other methods on this interface.

        Specified by:
        writeElementNode in interface SerializerVisitor
        Parameters:
        node - The node to write.
        writer - The writer to be written to.
        executionContext - ExecutionContext instance for the delivery context.
        Throws:
        IOException - Exception writing output.
      • writeChildElements

        public boolean writeChildElements()
        Description copied from interface: SerializerVisitor
        Write the child elements of the element this SerializationUnit is being applied to.
        Specified by:
        writeChildElements in interface SerializerVisitor
        Returns:
        True if the child elements are to be writen, otherwise false.