Class SyncDefaultRenderer

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

    public final class SyncDefaultRenderer
    extends Renderer
    Author:
    Tony Vaagenes
    • Constructor Detail

      • SyncDefaultRenderer

        public SyncDefaultRenderer()
    • Method Detail

      • init

        public void init()
        Overrides:
        init in class com.yahoo.processing.rendering.Renderer<Result>
      • getEncoding

        public java.lang.String getEncoding()
        Specified by:
        getEncoding in class com.yahoo.processing.rendering.Renderer<Result>
      • getMimeType

        public java.lang.String getMimeType()
        Specified by:
        getMimeType in class com.yahoo.processing.rendering.Renderer<Result>
      • getDefaultSummaryClass

        public java.lang.String getDefaultSummaryClass()
        Overrides:
        getDefaultSummaryClass in class Renderer
        Returns:
        The summary class to fill the hits with if no summary class was specified in the query presentation.
      • render

        public void render​(java.io.Writer writer,
                           Result result)
                    throws java.io.IOException
        Renders this result
        Specified by:
        render in class Renderer
        Throws:
        java.io.IOException
      • renderCoverageAttributes

        protected static void renderCoverageAttributes​(Coverage coverage,
                                                       com.yahoo.text.XMLWriter writer)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • endResult

        public void endResult​(com.yahoo.text.XMLWriter writer,
                              Result result)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • error

        public void error​(com.yahoo.text.XMLWriter writer,
                          Result result)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • emptyResult

        protected void emptyResult​(com.yahoo.text.XMLWriter writer,
                                   Result result)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • queryContext

        public void queryContext​(com.yahoo.text.XMLWriter writer,
                                 QueryContext queryContext,
                                 Query owner)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • renderHit

        public void renderHit​(com.yahoo.text.XMLWriter writer,
                              Hit hit,
                              int hitno)
                       throws java.io.IOException
        Renders this hit as xml. The default implementation will call the simpleRender() hook. If it returns true, nothing more is done, otherwise the given template set will be used for rendering.
        Parameters:
        writer - the XMLWriter to append this hit to
        Throws:
        java.io.IOException - if rendering fails
      • simpleRenderDefaultErrorHit

        public static boolean simpleRenderDefaultErrorHit​(com.yahoo.text.XMLWriter writer,
                                                          ErrorHit defaultErrorHit)
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • renderMessageDefaultErrorHit

        public static void renderMessageDefaultErrorHit​(com.yahoo.text.XMLWriter writer,
                                                        ErrorMessage error)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException