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
,java.lang.Cloneable
,java.lang.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 java.lang.String
DEFAULT_ENCODING
static java.lang.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)
java.lang.String
getDefaultSummaryClass()
java.lang.String
getEncoding()
java.lang.String
getMimeType()
void
init()
void
queryContext(com.yahoo.text.XMLWriter writer, QueryContext queryContext, Query owner)
void
render(java.io.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, render
-
-
-
-
Field Detail
-
DEFAULT_MIMETYPE
public static final java.lang.String DEFAULT_MIMETYPE
- See Also:
- Constant Field Values
-
DEFAULT_ENCODING
public static final java.lang.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 java.lang.String getEncoding()
- Specified by:
getEncoding
in classcom.yahoo.processing.rendering.Renderer<Result>
-
getMimeType
public java.lang.String getMimeType()
- Specified by:
getMimeType
in classcom.yahoo.processing.rendering.Renderer<Result>
-
getDefaultSummaryClass
public java.lang.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(java.io.Writer writer, Result result) throws java.io.IOException
Renders this result
-
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
-
-