Interface LinkResolverContext

    • Method Detail

      • encodeUrl

        @NotNull
        java.lang.String encodeUrl​(@NotNull
                                   java.lang.CharSequence url)
        Parameters:
        url - to be encoded
        Returns:
        an encoded URL (depending on the configuration)
      • render

        void render​(@NotNull
                    Node node)
        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.
        Parameters:
        node - the node to render
      • renderChildren

        void renderChildren​(@NotNull
                            Node parent)
        Render the children of the node, used by custom renderers
        Parameters:
        parent - node the children of which are to be rendered
      • getCurrentNode

        @NotNull
        Node getCurrentNode()
        Returns:
        the current node being rendered
      • resolveLink

        @NotNull
        default ResolvedLink resolveLink​(@NotNull
                                         LinkType linkType,
                                         @NotNull
                                         java.lang.CharSequence url,
                                         @Nullable
                                         java.lang.Boolean urlEncode)
        Resolve link for rendering. Link Resolvers are going to be called until one returns ResolvedLink with getStatus() != LinkStatus.Unknown

        A resolver can replace the url but not change the status letting downstream resolvers handle the rest. This is useful when a resolver does partial processing like macro expansion but does not know how to handle the rest.

        Core processing will simply pass the link as is. It is up to extension LinkResolvers and AttributeProviders to make sense of the link and applicable attributes based on status.

        Parameters:
        linkType - type of link being rendered. Core defined links are Link, Image. Extensions can define their own
        url - link url text
        urlEncode - whether the link should be url encoded, if null then the value of HtmlRenderer.PERCENT_ENCODE_URLS will be used to determine whether the resolved URL is to be encoded.
        Returns:
        resolved link url for this link and its resolved status
      • resolveLink

        @NotNull
        ResolvedLink resolveLink​(@NotNull
                                 LinkType linkType,
                                 @NotNull
                                 java.lang.CharSequence url,
                                 @Nullable
                                 Attributes attributes,
                                 @Nullable
                                 java.lang.Boolean urlEncode)
        Resolve link for rendering. Link Resolvers are going to be called until one returns ResolvedLink with getStatus() != LinkStatus.Unknown

        A resolver can replace the url but not change the status letting downstream resolvers handle the rest. This is useful when a resolver does partial processing like macro expansion but does not know how to handle the rest.

        Core processing will simply pass the link as is. It is up to extension LinkResolvers and AttributeProviders to make sense of the link and applicable attributes based on status.

        Parameters:
        linkType - type of link being rendered. Core defined links are Link, Image. Extensions can define their own
        url - link url text
        attributes - link attributes
        urlEncode - whether the link should be url encoded, if null then the value of HtmlRenderer.PERCENT_ENCODE_URLS will be used to determine whether the resolved URL is to be encoded.
        Returns:
        resolved link url for this link and its resolved status