Package com.yahoo.search.rendering
Class SyncDefaultRenderer
- java.lang.Object
-
- com.yahoo.component.AbstractComponent
-
- com.yahoo.processing.rendering.Renderer<Result>
-
- com.yahoo.search.rendering.Renderer
-
- com.yahoo.search.rendering.SyncDefaultRenderer
-
- All Implemented Interfaces:
com.yahoo.component.Component
,com.yahoo.component.Deconstructable
,Cloneable
,Comparable<com.yahoo.component.Component>
public final class SyncDefaultRenderer extends Renderer
- Author:
- Tony Vaagenes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyncDefaultRenderer.RenderingVisitor
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ENCODING
static String
DEFAULT_MIMETYPE
-
Constructor Summary
Constructors Constructor Description SyncDefaultRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
emptyResult(com.yahoo.text.XMLWriter writer, Result result)
void
endResult(com.yahoo.text.XMLWriter writer, Result result)
void
error(com.yahoo.text.XMLWriter writer, Result result)
String
getDefaultSummaryClass()
String
getEncoding()
String
getMimeType()
void
init()
void
queryContext(com.yahoo.text.XMLWriter writer, QueryContext queryContext, Query owner)
void
render(Writer writer, Result result)
Renders this resultprotected static void
renderCoverageAttributes(Coverage coverage, com.yahoo.text.XMLWriter writer)
void
renderHit(com.yahoo.text.XMLWriter writer, Hit hit, int hitno)
Renders this hit as xml.static void
renderMessageDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorMessage error)
static boolean
simpleRenderDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorHit defaultErrorHit)
-
Methods inherited from class com.yahoo.search.rendering.Renderer
clone, getCharacterEncoding, getRequestedEncoding, renderResponse
-
-
-
-
Field Detail
-
DEFAULT_MIMETYPE
public static final String DEFAULT_MIMETYPE
- See Also:
- Constant Field Values
-
DEFAULT_ENCODING
public static final String DEFAULT_ENCODING
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
- Overrides:
init
in classcom.yahoo.processing.rendering.Renderer<Result>
-
getEncoding
public String getEncoding()
- Specified by:
getEncoding
in classcom.yahoo.processing.rendering.Renderer<Result>
-
getMimeType
public String getMimeType()
- Specified by:
getMimeType
in classcom.yahoo.processing.rendering.Renderer<Result>
-
getDefaultSummaryClass
public String getDefaultSummaryClass()
- Overrides:
getDefaultSummaryClass
in classRenderer
- Returns:
- The summary class to fill the hits with if no summary class was specified in the query presentation.
-
render
public void render(Writer writer, Result result) throws IOException
Renders this result- Specified by:
render
in classRenderer
- Throws:
IOException
-
renderCoverageAttributes
protected static void renderCoverageAttributes(Coverage coverage, com.yahoo.text.XMLWriter writer) throws IOException
- Throws:
IOException
-
endResult
public void endResult(com.yahoo.text.XMLWriter writer, Result result) 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
-
renderHit
public void renderHit(com.yahoo.text.XMLWriter writer, Hit hit, int hitno) throws 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:
IOException
- if rendering fails
-
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
-
-