public final class SyncDefaultRenderer extends Renderer
Modifier and Type | Class and Description |
---|---|
static class |
SyncDefaultRenderer.RenderingVisitor |
Modifier and Type | Field and Description |
---|---|
private static com.yahoo.text.Utf8String |
CODE |
private Context |
context |
private static com.yahoo.text.Utf8String |
COVERAGE |
private static com.yahoo.text.Utf8String |
COVERAGE_DOCS |
private static com.yahoo.text.Utf8String |
COVERAGE_FULL |
private static com.yahoo.text.Utf8String |
COVERAGE_NODES |
static String |
DEFAULT_ENCODING |
static String |
DEFAULT_MIMETYPE |
private DefaultTemplateSet |
defaultTemplate |
private static com.yahoo.text.Utf8String |
ERROR |
private static com.yahoo.text.Utf8String |
FIELD |
private com.yahoo.concurrent.CopyOnWriteHashMap<String,com.yahoo.text.Utf8String> |
fieldNameMap |
private static com.yahoo.text.Utf8String |
GROUP |
private static com.yahoo.text.Utf8String |
HIT |
private static com.yahoo.text.Utf8String |
ID |
private static Logger |
log |
private static com.yahoo.text.Utf8String |
NAME |
private static com.yahoo.text.Utf8String |
QUERY_TIME |
private static com.yahoo.text.Utf8String |
RELEVANCY |
private static com.yahoo.text.Utf8String |
RESULT |
private static com.yahoo.text.Utf8String |
RESULTS |
private static com.yahoo.text.Utf8String |
RESULTS_FULL |
private static com.yahoo.text.Utf8String |
SEARCH_TIME |
private static com.yahoo.text.Utf8String |
SOURCE |
private static com.yahoo.text.Utf8String |
SUMMARY_FETCH_TIME |
private static com.yahoo.text.Utf8String |
TOTAL_HIT_COUNT |
private static com.yahoo.text.Utf8String |
TYPE |
Constructor and Description |
---|
SyncDefaultRenderer() |
Modifier and Type | Method and Description |
---|---|
private String |
asXML(Object value) |
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() |
private void |
handleException(Exception e) |
private void |
header(com.yahoo.text.XMLWriter writer,
Result result) |
void |
init() |
void |
queryContext(com.yahoo.text.XMLWriter writer,
QueryContext queryContext,
Query owner) |
void |
render(Writer writer,
Result result)
Renders this result
|
protected static void |
renderCoverageAttributes(Coverage coverage,
com.yahoo.text.XMLWriter writer) |
private void |
renderField(com.yahoo.text.XMLWriter writer,
String name,
Object value) |
private void |
renderFieldContent(com.yahoo.text.XMLWriter writer,
Object value) |
private void |
renderGroup(com.yahoo.text.XMLWriter writer,
HitGroup hit) |
void |
renderHit(com.yahoo.text.XMLWriter writer,
Hit hit,
int hitno)
Renders this hit as xml.
|
private void |
renderHitAttributes(com.yahoo.text.XMLWriter writer,
Hit hit) |
private void |
renderHitFields(com.yahoo.text.XMLWriter writer,
Hit hit) |
private void |
renderHitGroup(com.yahoo.text.XMLWriter writer,
HitGroup hit) |
private void |
renderHitGroup(com.yahoo.text.XMLWriter writer,
HitGroup hitGroup,
int hitnumber) |
private void |
renderHitGroupOfTypeGroupHit(com.yahoo.text.XMLWriter writer,
HitGroup hit) |
private void |
renderId(com.yahoo.text.XMLWriter writer,
HitGroup hit) |
static void |
renderMessageDefaultErrorHit(com.yahoo.text.XMLWriter writer,
ErrorMessage error) |
private void |
renderRegularHit(com.yahoo.text.XMLWriter writer,
Hit hit,
int hitno) |
private void |
renderSimpleField(com.yahoo.text.XMLWriter writer,
String relevancyFieldName,
Relevance relevance) |
private void |
renderSingularHit(com.yahoo.text.XMLWriter writer,
Hit hit) |
private void |
renderSyntheticRelevanceField(com.yahoo.text.XMLWriter writer,
Hit hit) |
private void |
renderTime(com.yahoo.text.XMLWriter writer,
Result result) |
static boolean |
simpleRenderDefaultErrorHit(com.yahoo.text.XMLWriter writer,
ErrorHit defaultErrorHit) |
private boolean |
simpleRenderHit(com.yahoo.text.XMLWriter writer,
Hit hit) |
private com.yahoo.text.XMLWriter |
wrapWriter(Writer writer) |
private void |
writeCloseFieldElement(com.yahoo.text.XMLWriter writer) |
private void |
writeOpenFieldElement(com.yahoo.text.XMLWriter writer,
String relevancyFieldName) |
clone, getCharacterEncoding, getRequestedEncoding, render
private static final Logger log
public static final String DEFAULT_MIMETYPE
public static final String DEFAULT_ENCODING
private static final com.yahoo.text.Utf8String RESULT
private static final com.yahoo.text.Utf8String GROUP
private static final com.yahoo.text.Utf8String ID
private static final com.yahoo.text.Utf8String FIELD
private static final com.yahoo.text.Utf8String HIT
private static final com.yahoo.text.Utf8String ERROR
private static final com.yahoo.text.Utf8String TOTAL_HIT_COUNT
private static final com.yahoo.text.Utf8String QUERY_TIME
private static final com.yahoo.text.Utf8String SUMMARY_FETCH_TIME
private static final com.yahoo.text.Utf8String SEARCH_TIME
private static final com.yahoo.text.Utf8String NAME
private static final com.yahoo.text.Utf8String CODE
private static final com.yahoo.text.Utf8String COVERAGE_DOCS
private static final com.yahoo.text.Utf8String COVERAGE_NODES
private static final com.yahoo.text.Utf8String COVERAGE_FULL
private static final com.yahoo.text.Utf8String COVERAGE
private static final com.yahoo.text.Utf8String RESULTS_FULL
private static final com.yahoo.text.Utf8String RESULTS
private static final com.yahoo.text.Utf8String TYPE
private static final com.yahoo.text.Utf8String RELEVANCY
private static final com.yahoo.text.Utf8String SOURCE
private Context context
private final DefaultTemplateSet defaultTemplate
private final com.yahoo.concurrent.CopyOnWriteHashMap<String,com.yahoo.text.Utf8String> fieldNameMap
public void init()
init
in class com.yahoo.processing.rendering.Renderer<Result>
public String getEncoding()
getEncoding
in class com.yahoo.processing.rendering.Renderer<Result>
public String getMimeType()
getMimeType
in class com.yahoo.processing.rendering.Renderer<Result>
public String getDefaultSummaryClass()
getDefaultSummaryClass
in class Renderer
private com.yahoo.text.XMLWriter wrapWriter(Writer writer)
public void render(Writer writer, Result result) throws IOException
render
in class Renderer
IOException
private void header(com.yahoo.text.XMLWriter writer, Result result) throws IOException
IOException
private void renderTime(com.yahoo.text.XMLWriter writer, Result result)
protected static void renderCoverageAttributes(Coverage coverage, com.yahoo.text.XMLWriter writer) throws IOException
IOException
public void endResult(com.yahoo.text.XMLWriter writer, Result result) throws IOException
IOException
public void error(com.yahoo.text.XMLWriter writer, Result result) throws IOException
IOException
protected void emptyResult(com.yahoo.text.XMLWriter writer, Result result) throws IOException
IOException
public void queryContext(com.yahoo.text.XMLWriter writer, QueryContext queryContext, Query owner) throws IOException
IOException
private void renderHitGroup(com.yahoo.text.XMLWriter writer, HitGroup hitGroup, int hitnumber) throws IOException
IOException
public void renderHit(com.yahoo.text.XMLWriter writer, Hit hit, int hitno) throws IOException
writer
- the XMLWriter to append this hit toIOException
- if rendering failsprivate void renderRegularHit(com.yahoo.text.XMLWriter writer, Hit hit, int hitno) throws IOException
IOException
private void renderSingularHit(com.yahoo.text.XMLWriter writer, Hit hit)
private void renderHitFields(com.yahoo.text.XMLWriter writer, Hit hit)
private void renderFieldContent(com.yahoo.text.XMLWriter writer, Object value)
private void renderSyntheticRelevanceField(com.yahoo.text.XMLWriter writer, Hit hit)
private void renderSimpleField(com.yahoo.text.XMLWriter writer, String relevancyFieldName, Relevance relevance)
private void writeCloseFieldElement(com.yahoo.text.XMLWriter writer)
private void writeOpenFieldElement(com.yahoo.text.XMLWriter writer, String relevancyFieldName)
private void renderHitAttributes(com.yahoo.text.XMLWriter writer, Hit hit)
private void renderHitGroup(com.yahoo.text.XMLWriter writer, HitGroup hit) throws IOException
IOException
private void renderGroup(com.yahoo.text.XMLWriter writer, HitGroup hit)
private void renderHitGroupOfTypeGroupHit(com.yahoo.text.XMLWriter writer, HitGroup hit)
private void renderId(com.yahoo.text.XMLWriter writer, HitGroup hit)
private boolean simpleRenderHit(com.yahoo.text.XMLWriter writer, Hit hit) throws IOException
IOException
public static boolean simpleRenderDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorHit defaultErrorHit) throws IOException
IOException
public static void renderMessageDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorMessage error) throws IOException
IOException
private void handleException(Exception e) throws IOException
IOException
Copyright © 2018. All rights reserved.