public abstract class AbstractResponseWriter<ResponseType extends OWSResponse> extends Object implements OWSResponseWriter<ResponseType>
Abstract base for all DOM based service response writers
Modifier and Type | Field and Description |
---|---|
static String |
ioError |
protected DateTimeFormat |
timeFormat |
static String |
unsupportedVersion |
static String |
xmlError |
Constructor and Description |
---|
AbstractResponseWriter() |
Modifier and Type | Method and Description |
---|---|
Element |
buildXMLResponse(DOMHelper dom,
ResponseType response)
Builds a DOM element containing the response XML.
Note that the element is not yet appended to any parent. |
abstract Element |
buildXMLResponse(DOMHelper dom,
ResponseType response,
String version)
Builds a DOM element containing the response XML for the given version.
Note that the element is not yet appended to any parent. |
void |
writeXMLResponse(OutputStream os,
ResponseType response)
Writes the XML response directly to the output stream
|
void |
writeXMLResponse(OutputStream os,
ResponseType response,
String version)
Writes the XML response for the desired version directly to the output stream
|
public static final String xmlError
public static final String ioError
public static final String unsupportedVersion
protected DateTimeFormat timeFormat
public abstract Element buildXMLResponse(DOMHelper dom, ResponseType response, String version) throws OWSException
OWSResponseWriter
buildXMLResponse
in interface OWSResponseWriter<ResponseType extends OWSResponse>
dom
- DOMHelper instance that will own the generated elementresponse
- response object to serialize as XMLversion
- version of writer to useOWSException
public Element buildXMLResponse(DOMHelper dom, ResponseType response) throws OWSException
OWSResponseWriter
buildXMLResponse
in interface OWSResponseWriter<ResponseType extends OWSResponse>
dom
- DOMHelper instance that will own the generated elementresponse
- response object to serialize as XMLOWSException
public void writeXMLResponse(OutputStream os, ResponseType response, String version) throws OWSException
OWSResponseWriter
writeXMLResponse
in interface OWSResponseWriter<ResponseType extends OWSResponse>
os
- output stream where the XML data will be writtenresponse
- response object to serialize as XMLversion
- version of writer to useOWSException
public void writeXMLResponse(OutputStream os, ResponseType response) throws OWSException
OWSResponseWriter
writeXMLResponse
in interface OWSResponseWriter<ResponseType extends OWSResponse>
os
- output stream where the XML data will be writtenresponse
- response object to serialize as XMLOWSException
Copyright © 2016 Sensia Software LLC. All rights reserved.