public interface LinkResolverContext
Modifier and Type | Method and Description |
---|---|
String |
encodeUrl(CharSequence url) |
Node |
getCurrentNode() |
Document |
getDocument() |
DataHolder |
getOptions()
Get the current rendering context
DataHolder . |
void |
render(Node node)
Render the specified node and its children using the configured renderers.
|
void |
renderChildren(Node parent)
Render the children of the node, used by custom renderers
|
ResolvedLink |
resolveLink(LinkType linkType,
CharSequence url,
Attributes attributes,
Boolean urlEncode)
Resolve link for rendering.
|
ResolvedLink |
resolveLink(LinkType linkType,
CharSequence url,
Boolean urlEncode)
Resolve link for rendering.
|
DataHolder getOptions()
DataHolder
. These are the options passed or set on the HtmlRenderer.builder()
or passed to HtmlRenderer.builder(DataHolder)
.
To get the document options you should use getDocument()
as the data holder.DataHolder
String encodeUrl(CharSequence url)
url
- to be encodedvoid render(Node node)
node
- the node to rendervoid renderChildren(Node parent)
parent
- node the children of which are to be renderedNode getCurrentNode()
ResolvedLink resolveLink(LinkType linkType, CharSequence url, Boolean urlEncode)
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.
linkType
- type of link being rendered. Core defined links are Link, Image. Extensions can define their ownurl
- link url texturlEncode
- 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.ResolvedLink resolveLink(LinkType linkType, CharSequence url, Attributes attributes, Boolean urlEncode)
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.
linkType
- type of link being rendered. Core defined links are Link, Image. Extensions can define their ownurl
- link url textattributes
- link attributesurlEncode
- 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.Copyright © 2018. All rights reserved.