Package com.yahoo.search.rendering
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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable -
Constructor Summary
ConstructorsConstructorDescriptionXmlRenderer(Executor executor) Creates an XML renderer using a custom executor. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginList(com.yahoo.processing.response.DataList<?> list) voidbeginResponse(OutputStream stream) voiddata(com.yahoo.processing.response.Data data) protected voidemptyResult(com.yahoo.text.XMLWriter writer, Result result) voidendList(com.yahoo.processing.response.DataList<?> list) voidvoidfinal StringgetRequestedEncoding(Query query) Returns the encoding of the query, or the encoding given by the template if none is setvoidinit()voidqueryContext(com.yahoo.text.XMLWriter writer, QueryContext queryContext, Query owner) protected static voidrenderCoverageAttributes(Coverage coverage, com.yahoo.text.XMLWriter writer) static voidrenderMessageDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorMessage error) static booleansimpleRenderDefaultErrorHit(com.yahoo.text.XMLWriter writer, ErrorHit defaultErrorHit) Methods inherited from class com.yahoo.processing.rendering.AsynchronousSectionedRenderer
clientClosed, deconstruct, getExecution, getRecursionLevel, getResponse, onClientClosed, renderResponse, renderResponseBeforeHandover, setNetworkWiringMethods inherited from class com.yahoo.processing.rendering.Renderer
cloneMethods inherited from class com.yahoo.component.AbstractComponent
compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Field Details
-
DEFAULT_MIMETYPE
- See Also:
-
DEFAULT_ENCODING
- See Also:
-
-
Constructor Details
-
XmlRenderer
public XmlRenderer() -
XmlRenderer
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:
initin classcom.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
-
getEncoding
- Specified by:
getEncodingin classcom.yahoo.processing.rendering.Renderer<Result>
-
getMimeType
- Specified by:
getMimeTypein classcom.yahoo.processing.rendering.Renderer<Result>
-
renderCoverageAttributes
protected static void renderCoverageAttributes(Coverage coverage, com.yahoo.text.XMLWriter writer) throws IOException - Throws:
IOException
-
error
- Throws:
IOException
-
emptyResult
- 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
- Specified by:
beginResponsein classcom.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>- Throws:
IOException
-
getRequestedEncoding
Returns the encoding of the query, or the encoding given by the template if none is set -
beginList
- Specified by:
beginListin classcom.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>- Throws:
IOException
-
data
- Specified by:
datain classcom.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>- Throws:
IOException
-
endList
public void endList(com.yahoo.processing.response.DataList<?> list) - Specified by:
endListin classcom.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
-
endResponse
public void endResponse()- Specified by:
endResponsein classcom.yahoo.processing.rendering.AsynchronousSectionedRenderer<Result>
-