Class Renderer

  • All Implemented Interfaces:, PageElement

    public final class Renderer
    implements PageElement
    A description of a way to present data items from a source. All data items has a default renderer. This can be overridden or parametrized by an explicit renderer.
    • Constructor Summary

      Constructor Description
      Renderer​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(PageTemplateVisitor visitor)
      Accepts a visitor to this structure
      void freeze()  
      java.lang.String getName()
      Returns the name of this renderer (never null).
      java.lang.String getRendererFor()
      Returns the name of the kind of data this is a renderer for.
      java.util.Map<java.lang.String,​java.lang.String> parameters()
      Returns the parameters of this renderer as a live reference (never null).
      void setName​(java.lang.String name)  
      void setRendererFor​(java.lang.String rendererFor)  
      java.lang.String toString()  
      • Methods inherited from class

        clone, ensureNotFrozen, isFrozen
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface

    • Constructor Detail

      • Renderer

        public Renderer​(java.lang.String name)
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of this renderer (never null). The name should be recognized by the system receiving results for rendering
      • setName

        public final void setName​(java.lang.String name)
      • getRendererFor

        public java.lang.String getRendererFor()
        Returns the name of the kind of data this is a renderer for. This is used to allow frontends to dispatch the right data items (hits) to the right renderer in the case where the data consists of a heterogeneous list.

        This is null if this is a renderer for a whole section, or if this is a renderer for all kinds of data from a particular source and this is not frozen.

        Otherwise, it is either the name of the source this is the renderer for, or the renderer for all data items having this name as a type.

        This, a (frontend) dispatcher of data to renderers should for each data item:

        • use the renderer having the same name as any type name set of the data item
        • if no such renderer, use the renderer having rendererFor equal to the data items source
        • if no such renderer, use a default renderer
      • setRendererFor

        public void setRendererFor​(java.lang.String rendererFor)
      • parameters

        public java.util.Map<java.lang.String,​java.lang.String> parameters()
        Returns the parameters of this renderer as a live reference (never null). The parameters will be passed to the renderer with each result
      • freeze

        public void freeze()
        Specified by:
        freeze in interface
        freeze in class
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object