public class

OutputTypeAwareHrefEvaluator

extends Object
implements HrefEvaluator
java.lang.Object
   ↳ com.atlassian.confluence.content.render.xhtml.links.OutputTypeAwareHrefEvaluator

Class Overview

An HrefEvaluator which inspects the ConversionContextOutputType in the ConversionContext and evaluates href values appropriately for the output type targeted.

Summary

Public Constructors
OutputTypeAwareHrefEvaluator(Map<StringHrefEvaluator> outputTypeEvaluators, HrefEvaluator defaultEvaluator)
Public Methods
String createHref(ConversionContext context, Object entity, String anchor)
Create the appropriate href attribute value for the supplied ConversionContext.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.content.render.xhtml.links.HrefEvaluator

Public Constructors

public OutputTypeAwareHrefEvaluator (Map<StringHrefEvaluator> outputTypeEvaluators, HrefEvaluator defaultEvaluator)

Parameters
outputTypeEvaluators a Map where the key is a ConversionContextOutputType and the value is the HrefEvaluator to use for that output type
defaultEvaluator the HrefEvaluator to use if no specific one is found

Public Methods

public String createHref (ConversionContext context, Object entity, String anchor)

Create the appropriate href attribute value for the supplied ConversionContext.

Parameters
context the ConversionContext providing information about the conversion being performed, including the target output type e.g. display, pdf
entity the object
anchor an option parameter specifying an anchor component for the href attribute. This may be null if there is no destination anchor.
Returns
  • the attribute value appropriate for the outputType specified.