Package org.n52.svalbard.encode
Class AbstractXmlResponseEncoder<T>
- java.lang.Object
-
- org.n52.svalbard.encode.AbstractDelegatingEncoder<T,S>
-
- org.n52.svalbard.encode.AbstractXmlEncoder<org.apache.xmlbeans.XmlObject,T>
-
- org.n52.svalbard.encode.AbstractXmlResponseEncoder<T>
-
- Type Parameters:
T- the response type
- All Implemented Interfaces:
Component<EncoderKey>,Keyed<EncoderKey>,ConformanceClass,Encoder<org.apache.xmlbeans.XmlObject,T>,SchemaAwareEncoder<org.apache.xmlbeans.XmlObject,T>,StreamingEncoder<org.apache.xmlbeans.XmlObject,T>
- Direct Known Subclasses:
AbstractRequestEncoder,AbstractResponseEncoder
@Configurable public abstract class AbstractXmlResponseEncoder<T> extends AbstractXmlEncoder<org.apache.xmlbeans.XmlObject,T> implements StreamingEncoder<org.apache.xmlbeans.XmlObject,T>, ConformanceClass
- Since:
- 5.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractXmlResponseEncoder(String service, String version, String operation, String namespace, String prefix, Class<T> responseType)constructorAbstractXmlResponseEncoder(String service, String version, String operation, String namespace, String prefix, Class<T> responseType, boolean validate)constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddNamespacePrefixToMap(Map<String,String> nameSpacePrefixMap)protected abstract org.apache.xmlbeans.XmlObjectcreate(T response)Create anXmlObjectfrom theOwsServiceResponseobjectprotected voidcreate(T response, OutputStream outputStream, EncodingContext encodingValues)Override this method in concrete response encoder if streaming is supported for this operations.org.apache.xmlbeans.XmlObjectencode(T response)org.apache.xmlbeans.XmlObjectencode(T response, EncodingContext additionalValues)protected abstract Set<SchemaLocation>getConcreteSchemaLocations()Get the concrete schema locations for thisOwsServiceResponseencoderprotected Set<SchemaLocation>getConcreteSchemaLocations(String namespace)protected Class<T>getResponseType()SchemaRepositorygetSchemaRepository()voidsetSchemaRepository(SchemaRepository schemaRepository)voidsetValidate(boolean validate)-
Methods inherited from class org.n52.svalbard.encode.AbstractXmlEncoder
encodeObjectToXml, encodeObjectToXml, encodeObjectToXmlDocument, encodeObjectToXmlDocument, encodeObjectToXmlPropertyType, encodeObjectToXmlPropertyType, encodeObjectToXmlText, encodeObjectToXmlText, getAndCheck, getContentType, getDocumentEncoder, getDocumentEncoder, getDocumentEncoderKey, getDocumentEncoderKey, getEncoder, getEncoder, getEncoderKey, getEncoderKey, getPropertyTypeEncoder, getPropertyTypeEncoder, getPropertyTypeEncoderKey, getPropertyTypeEncoderKey, getXmlOptions, setXmlOptions, substitute
-
Methods inherited from class org.n52.svalbard.encode.AbstractDelegatingEncoder
getEncoder, getEncoderRepository, setEncoderRepository
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.n52.svalbard.ConformanceClass
getConformanceClasses
-
Methods inherited from interface org.n52.svalbard.encode.Encoder
getContentType, getSupportedTypes
-
Methods inherited from interface org.n52.svalbard.encode.SchemaAwareEncoder
getSchemaLocations
-
Methods inherited from interface org.n52.svalbard.encode.StreamingEncoder
encode, encode
-
-
-
-
Constructor Detail
-
AbstractXmlResponseEncoder
public AbstractXmlResponseEncoder(String service, String version, String operation, String namespace, String prefix, Class<T> responseType, boolean validate)
constructor- Parameters:
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 validated
-
AbstractXmlResponseEncoder
public AbstractXmlResponseEncoder(String service, String version, String operation, String namespace, String prefix, Class<T> responseType)
constructor- Parameters:
service- Serviceversion- Service versionoperation- Service operation namenamespace- Service XML schema namespaceprefix- Service XML schema prefixresponseType- Response type
-
-
Method Detail
-
setSchemaRepository
@Inject public void setSchemaRepository(SchemaRepository schemaRepository)
-
getSchemaRepository
public SchemaRepository getSchemaRepository()
-
setValidate
@Setting(value="service.response.validate", required=false) public void setValidate(boolean validate)
-
addNamespacePrefixToMap
public void addNamespacePrefixToMap(Map<String,String> nameSpacePrefixMap)
- Specified by:
addNamespacePrefixToMapin interfaceSchemaAwareEncoder<org.apache.xmlbeans.XmlObject,T>
-
encode
public org.apache.xmlbeans.XmlObject encode(T response) throws EncodingException
- Specified by:
encodein interfaceEncoder<org.apache.xmlbeans.XmlObject,T>- Overrides:
encodein classAbstractXmlEncoder<org.apache.xmlbeans.XmlObject,T>- Throws:
EncodingException
-
encode
public org.apache.xmlbeans.XmlObject encode(T response, EncodingContext additionalValues) throws EncodingException
- Specified by:
encodein interfaceEncoder<org.apache.xmlbeans.XmlObject,T>- Throws:
EncodingException
-
getConcreteSchemaLocations
protected abstract Set<SchemaLocation> getConcreteSchemaLocations()
Get the concrete schema locations for thisOwsServiceResponseencoder- Returns:
- the concrete schema locations
-
getConcreteSchemaLocations
protected Set<SchemaLocation> getConcreteSchemaLocations(String namespace)
-
create
protected abstract org.apache.xmlbeans.XmlObject create(T response) throws EncodingException
Create anXmlObjectfrom theOwsServiceResponseobject- Parameters:
response-OwsServiceResponseto encode- Returns:
- XML encoded
OwsServiceResponse - Throws:
EncodingException- If an error occurs during the encoding
-
create
protected void create(T response, OutputStream outputStream, EncodingContext encodingValues) throws EncodingException
Override this method in concrete response encoder if streaming is supported for this operations.- Parameters:
response- Implementation ofOwsServiceResponseoutputStream-OutputStreamto writeencodingValues-EncodingContextwith additional indicators for encoding- Throws:
EncodingException- If an error occurs during encoding/writing to stream
-
-