Class RendererContextBase

java.lang.Object
com.aquima.interactions.framework.renderer.RendererContextBase
All Implemented Interfaces:
IRendererContext
Direct Known Subclasses:
XmlRendererContext

public abstract class RendererContextBase extends Object implements IRendererContext
This class provides context information to the renderers.
Since:
7.0
Author:
Jon van Leuven
  • Constructor Details

    • RendererContextBase

      public RendererContextBase(Map<String,IElementRenderer> renderers, ApplicationID applicationId, ILanguage language, ILanguage defaultLanguage, IParameters parameters, IElementRenderer defaultRenderer, IRuntimeKeyPrinter printer)
      Constructs the context with the required arguments.
      Parameters:
      renderers - Map containing the renderers for the supported page elements, may not be null.
      applicationId - The ID of the application for which the conversion is done, may not be null.
      language - The language that should be used, may not be null.
      defaultLanguage - The language that should be used when an element does not have a value for the main language, may not be null.
      parameters - Additional parameters for the context, may not be null.
      defaultRenderer - Optional default renderer, will be used when renderer could be found, may be null.
      printer - Optional runtime key printer, may be null.
  • Method Details

    • getApplicationID

      public ApplicationID getApplicationID()
      Description copied from interface: IRendererContext
      The rendering is done for a certain application.
      Specified by:
      getApplicationID in interface IRendererContext
      Returns:
      The application id of the application.
    • getDefaultLanguage

      public ILanguage getDefaultLanguage()
      Description copied from interface: IRendererContext
      In some cases fallback behaviour of language text display is needed, so a 'default' fallback language is provided.
      Specified by:
      getDefaultLanguage in interface IRendererContext
      Returns:
      The default fallback language
    • getLanguage

      public ILanguage getLanguage()
      Description copied from interface: IRendererContext
      Rendering should be done for a specific language.
      Specified by:
      getLanguage in interface IRendererContext
      Returns:
      The language which should be used to render 'texts'
    • getParameters

      public IParameters getParameters()
      Description copied from interface: IRendererContext
      Some additional parameters which should be available to the implementor.
      Specified by:
      getParameters in interface IRendererContext
      Returns:
      The parameters.
    • getRuntimeKeyPrinter

      public IRuntimeKeyPrinter getRuntimeKeyPrinter()
      Description copied from interface: IRendererContext
      This method returns an optional runtime key printer that can be used to convert runtime keys of elements.
      Specified by:
      getRuntimeKeyPrinter in interface IRendererContext
      Returns:
      The optional runtime key printer, may be null.
    • locateRenderer

      protected IElementRenderer locateRenderer(Object element)
      This returns a renderer for a specified element, should never return null.
      Parameters:
      element - The element used for renderer lookup.
      Returns:
      The renderer, never null
      Throws:
      InvalidStateException - When no renderer could be located.
    • getHandlerByClass

      protected IElementRenderer getHandlerByClass(Class<?> elementClass)