Class HtmlRenderer.RendererContext

    • Constructor Detail

      • RendererContext

        private RendererContext​(HtmlWriter htmlWriter)
    • Method Detail

      • encodeUrl

        public java.lang.String encodeUrl​(java.lang.String url)
        Specified by:
        encodeUrl in interface HtmlNodeRendererContext
        Parameters:
        url - to be encoded
        Returns:
        an encoded URL (depending on the configuration)
      • extendAttributes

        public java.util.Map<java.lang.String,​java.lang.String> extendAttributes​(Node node,
                                                                                       java.lang.String tagName,
                                                                                       java.util.Map<java.lang.String,​java.lang.String> attributes)
        Description copied from interface: HtmlNodeRendererContext
        Let extensions modify the HTML tag attributes.
        Specified by:
        extendAttributes in interface HtmlNodeRendererContext
        Parameters:
        node - the node for which the attributes are applied
        tagName - the HTML tag name that these attributes are for (e.g. h1, pre, code).
        attributes - the attributes that were calculated by the renderer
        Returns:
        the extended attributes with added/updated/removed entries
      • getSoftbreak

        public java.lang.String getSoftbreak()
        Specified by:
        getSoftbreak in interface HtmlNodeRendererContext
        Returns:
        HTML that should be rendered for a soft line break
      • render

        public void render​(Node node)
        Description copied from interface: HtmlNodeRendererContext
        Render the specified node and its children using the configured renderers. This should be used to render child nodes; be careful not to pass the node that is being rendered, that would result in an endless loop.
        Specified by:
        render in interface HtmlNodeRendererContext
        Parameters:
        node - the node to render
      • setCustomAttributes

        private void setCustomAttributes​(Node node,
                                         java.lang.String tagName,
                                         java.util.Map<java.lang.String,​java.lang.String> attrs)