Package org.n52.svalbard.encode
Class AbstractXmlResponseEncoder<T>
java.lang.Object
org.n52.svalbard.encode.AbstractDelegatingEncoder<org.apache.xmlbeans.XmlObject,T>
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
ConstructorsConstructorDescriptionAbstractXmlResponseEncoder(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
Modifier and TypeMethodDescriptionvoidaddNamespacePrefixToMap(Map<String, String> nameSpacePrefixMap) protected abstract org.apache.xmlbeans.XmlObjectCreate 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.XmlObjectorg.apache.xmlbeans.XmlObjectencode(T response, EncodingContext additionalValues) protected abstract Set<SchemaLocation> Get the concrete schema locations for thisOwsServiceResponseencoderprotected Set<SchemaLocation> getConcreteSchemaLocations(String namespace) 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, substituteMethods inherited from class org.n52.svalbard.encode.AbstractDelegatingEncoder
getEncoder, getEncoderRepository, setEncoderRepositoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.n52.svalbard.ConformanceClass
getConformanceClassesMethods inherited from interface org.n52.svalbard.encode.Encoder
getContentType, getSupportedTypesMethods inherited from interface org.n52.svalbard.encode.SchemaAwareEncoder
getSchemaLocationsMethods inherited from interface org.n52.svalbard.encode.StreamingEncoder
encode, encode
-
Constructor Details
-
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 Details
-
setSchemaRepository
-
getSchemaRepository
-
setValidate
-
addNamespacePrefixToMap
- Specified by:
addNamespacePrefixToMapin interfaceSchemaAwareEncoder<org.apache.xmlbeans.XmlObject,T>
-
encode
- 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
Get the concrete schema locations for thisOwsServiceResponseencoder- Returns:
- the concrete schema locations
-
getConcreteSchemaLocations
-
create
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
-
getResponseType
-