Class XmlRenderer

java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.processing.rendering.Renderer<RESPONSE>
com.yahoo.processing.rendering.AsynchronousRenderer<RESPONSE>
com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
com.yahoo.search.rendering.XmlRenderer
All Implemented Interfaces:
com.yahoo.component.Component, com.yahoo.component.Deconstructable, Cloneable, Comparable<com.yahoo.component.Component>

public final class XmlRenderer extends com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
XML rendering of search results.
Author:
Tony Vaagenes
  • Field Details

  • Constructor Details

    • XmlRenderer

      public XmlRenderer()
    • XmlRenderer

      public XmlRenderer(Executor executor)
      Creates an XML renderer using a custom executor. Using a custom executor is useful for tests to avoid creating new threads for each renderer registry.
  • Method Details

    • init

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

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

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

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

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

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

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

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

      public static void renderMessageDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorMessage error) throws IOException
      Throws:
      IOException
    • beginResponse

      public void beginResponse(OutputStream stream) throws IOException
      Specified by:
      beginResponse in class com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
      Throws:
      IOException
    • getRequestedEncoding

      public final String getRequestedEncoding(Query query)
      Returns the encoding of the query, or the encoding given by the template if none is set
    • beginList

      public void beginList(com.yahoo.processing.response.DataList<?> list) throws IOException
      Specified by:
      beginList in class com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
      Throws:
      IOException
    • data

      public void data(com.yahoo.processing.response.Data data) throws IOException
      Specified by:
      data in class com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
      Throws:
      IOException
    • endList

      public void endList(com.yahoo.processing.response.DataList<?> list)
      Specified by:
      endList in class com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
    • endResponse

      public void endResponse()
      Specified by:
      endResponse in class com.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>