T
- the response typepublic abstract class AbstractResponseEncoder<T extends AbstractServiceResponse> extends AbstractXmlEncoder<T> implements StreamingEncoder<org.apache.xmlbeans.XmlObject,T>
Modifier and Type | Field and Description |
---|---|
private Set<EncoderKey> |
encoderKeys |
private static org.slf4j.Logger |
LOGGER |
private String |
namespace |
private String |
prefix |
private Class<T> |
responseType |
private boolean |
validate |
private String |
version |
Constructor and Description |
---|
AbstractResponseEncoder(String service,
String version,
String operation,
String namespace,
String prefix,
Class<T> responseType)
constructor
|
AbstractResponseEncoder(String service,
String version,
String operation,
String namespace,
String prefix,
Class<T> responseType,
boolean validate)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addNamespacePrefixToMap(Map<String,String> nameSpacePrefixMap)
|
protected abstract org.apache.xmlbeans.XmlObject |
create(T response)
Create an
XmlObject from the AbstractServiceResponse
object |
protected void |
create(T response,
OutputStream outputStream,
EncodingValues encodingValues)
Override this method in concrete response encoder if streaming is
supported for this operations.
|
org.apache.xmlbeans.XmlObject |
encode(T response)
Encodes the specified object.
|
org.apache.xmlbeans.XmlObject |
encode(T response,
Map<SosConstants.HelperValues,String> additionalValues)
Encodes the specified object with the specified SosConstants.HelperValues
.
|
void |
encode(T element,
OutputStream outputStream) |
void |
encode(T response,
OutputStream outputStream,
EncodingValues encodingValues) |
boolean |
forceStreaming() |
protected abstract Set<SchemaLocation> |
getConcreteSchemaLocations()
Get the concrete schema locations for this
AbstractServiceResponse encoder |
Set<EncoderKey> |
getEncoderKeyType() |
protected Class<T> |
getResponseType() |
protected org.apache.xmlbeans.XmlOptions |
getXmlOptions() |
private void |
setSchemaLocations(org.apache.xmlbeans.XmlObject document) |
protected void |
writeIndent(int level,
OutputStream outputStream)
Write indent to stream if the response is encoded with XmlBeans
|
getConformanceClasses, getContentType, getSchemaLocations, getSupportedTypes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContentType, getSchemaLocations, getSupportedTypes
getConformanceClasses
private static final org.slf4j.Logger LOGGER
private final Set<EncoderKey> encoderKeys
private final String namespace
private final String prefix
private final String version
private final Class<T extends AbstractServiceResponse> responseType
private final boolean validate
public AbstractResponseEncoder(String service, String version, String operation, String namespace, String prefix, Class<T> responseType, boolean validate)
service
- Serviceversion
- Service versionoperation
- Service operation namenamespace
- Service XML schema namespaceprefix
- Service XML schema prefixresponseType
- Response typevalidate
- Indicator if the created/encoded object should be validatedpublic AbstractResponseEncoder(String service, String version, String operation, String namespace, String prefix, Class<T> responseType)
service
- Serviceversion
- Service versionoperation
- Service operation namenamespace
- Service XML schema namespaceprefix
- Service XML schema prefixresponseType
- Response typepublic Set<EncoderKey> getEncoderKeyType()
getEncoderKeyType
in interface Encoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
EncoderKey
)public void addNamespacePrefixToMap(Map<String,String> nameSpacePrefixMap)
Encoder
addNamespacePrefixToMap
in interface Encoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
addNamespacePrefixToMap
in class AbstractXmlEncoder<T extends AbstractServiceResponse>
public org.apache.xmlbeans.XmlObject encode(T response) throws OwsExceptionReport
Encoder
encode
in interface Encoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
encode
in class AbstractXmlEncoder<T extends AbstractServiceResponse>
response
- the object to encodeOwsExceptionReport
- if an error occursUnsupportedEncoderInputException
- if the supplied object (or any of it's contents) is not
supported by this encoderpublic org.apache.xmlbeans.XmlObject encode(T response, Map<SosConstants.HelperValues,String> additionalValues) throws OwsExceptionReport
Encoder
encode
in interface Encoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
response
- the object to encodeadditionalValues
- the helper valuesOwsExceptionReport
- if an error occursUnsupportedEncoderInputException
- if the supplied object (or any of it's contents) is not
supported by this encoderpublic void encode(T element, OutputStream outputStream) throws OwsExceptionReport
encode
in interface StreamingEncoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
OwsExceptionReport
public void encode(T response, OutputStream outputStream, EncodingValues encodingValues) throws OwsExceptionReport
encode
in interface StreamingEncoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
OwsExceptionReport
public boolean forceStreaming()
forceStreaming
in interface StreamingEncoder<org.apache.xmlbeans.XmlObject,T extends AbstractServiceResponse>
private void setSchemaLocations(org.apache.xmlbeans.XmlObject document)
protected org.apache.xmlbeans.XmlOptions getXmlOptions()
protected abstract Set<SchemaLocation> getConcreteSchemaLocations()
AbstractServiceResponse
encoderprotected abstract org.apache.xmlbeans.XmlObject create(T response) throws OwsExceptionReport
XmlObject
from the AbstractServiceResponse
objectresponse
- AbstractServiceResponse
to encodeAbstractServiceResponse
OwsExceptionReport
- If an error occurs during the encodingprotected void create(T response, OutputStream outputStream, EncodingValues encodingValues) throws OwsExceptionReport
response
- Implementation of AbstractServiceResponse
outputStream
- OutputStream
to writeencodingValues
- EncodingValues
with additional indicators for encodingOwsExceptionReport
- If an error occurs during encoding/writing to streamprotected void writeIndent(int level, OutputStream outputStream) throws IOException
level
- Level of indentoutputStream
- OutputStream
to write indentIOException
- If an error occurs when writing to streamCopyright © 2012-2015 52north.org. All Rights Reserved.