Class SectionedRenderer<WRITER>

  • All Implemented Interfaces:
    com.yahoo.component.Component, com.yahoo.component.Deconstructable, Cloneable, Comparable<com.yahoo.component.Component>

    public abstract class SectionedRenderer<WRITER>
    extends Renderer
    Renders each part of a result to a writer. The renderers are cloned just before rendering, and must therefore obey the following contract:
    1. At construction time, only final members shall be initialized, and these must refer to immutable data only.
    2. State mutated during rendering shall be initialized in the init method.
    Author:
    Tony Vaagenes
    • Constructor Detail

      • SectionedRenderer

        public SectionedRenderer()
    • Method Detail

      • wrapWriter

        public WRITER wrapWriter​(Writer writer)
        Wraps the Writer instance. The result is given as a parameter to all the callback methods. Must be overridden if the generic parameter WRITER != java.io.Writer.
      • queryContext

        public abstract void queryContext​(WRITER writer,
                                          QueryContext queryContext)
                                   throws IOException
        Called if there is a non-null query context for the query of the result.
        Throws:
        IOException
      • beginHitGroup

        public abstract void beginHitGroup​(WRITER writer,
                                           HitGroup hitGroup)
                                    throws IOException
        Called when a HitGroup is encountered. After all its children have been provided to methods of this class, endHitGroup is called.
        Throws:
        IOException
      • endHitGroup

        public abstract void endHitGroup​(WRITER writer,
                                         HitGroup hitGroup)
                                  throws IOException
        Called after all the children of the HitGroup have been provided to methods of this class. See beginHitGroup.
        Throws:
        IOException
      • errorHit

        public void errorHit​(WRITER writer,
                             ErrorHit errorHit)
                      throws IOException
        Called when an errorHit is encountered. Forwards to hit() per default.
        Throws:
        IOException
      • beginGroup

        public void beginGroup​(WRITER writer,
                               Group group)
                        throws IOException
        Same as beginHitGroup, but for Group(grouping api). Forwards to beginHitGroup() per default.
        Throws:
        IOException
      • endGroup

        public void endGroup​(WRITER writer,
                             Group group)
                      throws IOException
        Same as endHitGroup, but for Group(grouping api). Forwards to endHitGroup() per default.
        Throws:
        IOException
      • beginGroupList

        public void beginGroupList​(WRITER writer,
                                   GroupList groupList)
                            throws IOException
        Same as beginHitGroup, but for GroupList(grouping api). Forwards to beginHitGroup() per default.
        Throws:
        IOException
      • endGroupList

        public void endGroupList​(WRITER writer,
                                 GroupList groupList)
                          throws IOException
        Same as endHitGroup, but for GroupList(grouping api). Forwards to endHitGroup() per default.
        Throws:
        IOException
      • beginHitList

        public void beginHitList​(WRITER writer,
                                 HitList hitList)
                          throws IOException
        Same as beginHitGroup, but for HitList(grouping api). Forwards to beginHitGroup() per default.
        Throws:
        IOException
      • endHitList

        public void endHitList​(WRITER writer,
                               HitList hitList)
                        throws IOException
        Same as endHitGroup, but for HitList(grouping api). Forwards to endHitGroup() per default.
        Throws:
        IOException