Package org.n52.svalbard.encode
Class AbstractOmEncoderv20
java.lang.Object
org.n52.svalbard.encode.AbstractDelegatingEncoder<org.apache.xmlbeans.XmlObject,Object>
org.n52.svalbard.encode.AbstractXmlEncoder<org.apache.xmlbeans.XmlObject,Object>
org.n52.svalbard.encode.AbstractOmEncoderv20
- All Implemented Interfaces:
Component<EncoderKey>,Keyed<EncoderKey>,ConformanceClass,Encoder<org.apache.xmlbeans.XmlObject,,Object> ObservationEncoder<org.apache.xmlbeans.XmlObject,,Object> SchemaAwareEncoder<org.apache.xmlbeans.XmlObject,,Object> StreamingEncoder<org.apache.xmlbeans.XmlObject,Object>
- Direct Known Subclasses:
AbstractTsmlEncoderv10,AbstractWmlEncoderv20,OmEncoderv20
public abstract class AbstractOmEncoderv20
extends AbstractXmlEncoder<org.apache.xmlbeans.XmlObject,Object>
implements ObservationEncoder<org.apache.xmlbeans.XmlObject,Object>, StreamingEncoder<org.apache.xmlbeans.XmlObject,Object>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddAddtitionalInformation(net.opengis.om.x20.OMObservationType omot, OmObservation observation) voidaddNamespacePrefixToMap(Map<String, String> nameSpacePrefixMap) protected abstract voidaddObservationType(net.opengis.om.x20.OMObservationType xbObservation, String observationType) Method to add the observation type to the om:Observation.protected abstract booleanIndicator whether the procedure is to be encodedprotected net.opengis.om.x20.NamedValueTypecreateNamedValue(NamedValue<?> sosNamedValue) Method to encode a SOS NamedValue to an XmlBeans representationprotected abstract net.opengis.om.x20.OMObservationTypeprotected abstract org.apache.xmlbeans.XmlObjectcreateResult(OmObservation sosObservation) Method to create the om:result element contentvoidencode(Object objectToEncode, OutputStream outputStream, EncodingContext ctx) org.apache.xmlbeans.XmlObjectencode(Object element, EncodingContext additionalValues) protected org.apache.xmlbeans.XmlObjectprotected org.apache.xmlbeans.XmlObjectencodeGML(Object o, EncodingContext context) protected org.apache.xmlbeans.XmlObjectencodeGWML(Object o) protected org.apache.xmlbeans.XmlObjectencodeGWML(Object o, EncodingContext context) protected org.apache.xmlbeans.XmlObjectencodeOmObservation(OmObservation sosObservation, EncodingContext context) Method to create an O&M 2.0 observation XmlBeans objectprotected abstract org.apache.xmlbeans.XmlObjectencodeResult(ObservationValue<?> observationValue) protected org.apache.xmlbeans.XmlObjectprotected org.apache.xmlbeans.XmlObjectencodeSweCommon(Object o, EncodingContext context) protected org.apache.xmlbeans.XmlObjectprotected org.apache.xmlbeans.XmlObjectencodeXLINK(Object o, EncodingContext context) abstract StringGet the default encoding Namespace for FeatureOfInterestprotected abstract StringGet the default encoding Namespace for Proceduresprotected voidsetObservationType(OmObservation observation, net.opengis.om.x20.OMObservationType xb) Methods inherited from class org.n52.svalbard.encode.AbstractXmlEncoder
encode, 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
encode, getContentType, getSupportedTypesMethods inherited from interface org.n52.svalbard.encode.ObservationEncoder
getProcedureEncodingNamspace, getSupportedResponseFormatObservationTypes, getSupportedResponseFormats, getSupportedResponseFormats, isObservationAndMeasurmentV20Type, shouldObservationsWithSameXBeMerged, supportsResultStreamingForMergedValuesMethods inherited from interface org.n52.svalbard.encode.SchemaAwareEncoder
getSchemaLocationsMethods inherited from interface org.n52.svalbard.encode.StreamingEncoder
encode
-
Constructor Details
-
AbstractOmEncoderv20
public AbstractOmEncoderv20()
-
-
Method Details
-
createResult
protected abstract org.apache.xmlbeans.XmlObject createResult(OmObservation sosObservation) throws EncodingException Method to create the om:result element content- Parameters:
sosObservation- SosObservation to be encoded- Returns:
- XML encoded result object, e.g a gml:MeasureType
- Throws:
EncodingException- if an error occurs
-
encodeResult
protected abstract org.apache.xmlbeans.XmlObject encodeResult(ObservationValue<?> observationValue) throws EncodingException - Throws:
EncodingException
-
addObservationType
protected abstract void addObservationType(net.opengis.om.x20.OMObservationType xbObservation, String observationType) Method to add the observation type to the om:Observation. Subclasses should have mappings to set the correct type, e.g. O&M .../Measurement == .../MeasurementTimeseriesTVPObservation in WaterML 2.0- Parameters:
xbObservation- XmlBeans object of observationobservationType- Observation type
-
getDefaultFeatureEncodingNamespace
Get the default encoding Namespace for FeatureOfInterest- Returns:
- Encoding namespace
-
getDefaultProcedureEncodingNamspace
Get the default encoding Namespace for Procedures- Returns:
- Encoding namespace
-
convertEncodedProcedure
protected abstract boolean convertEncodedProcedure()Indicator whether the procedure is to be encoded- Returns:
- Indicator
-
createOmObservationType
protected abstract net.opengis.om.x20.OMObservationType createOmObservationType() -
addAddtitionalInformation
protected abstract void addAddtitionalInformation(net.opengis.om.x20.OMObservationType omot, OmObservation observation) throws EncodingException - Throws:
EncodingException
-
encode
public org.apache.xmlbeans.XmlObject encode(Object element, EncodingContext additionalValues) throws EncodingException - Specified by:
encodein interfaceEncoder<org.apache.xmlbeans.XmlObject,Object> - Throws:
EncodingException
-
encode
public void encode(Object objectToEncode, OutputStream outputStream, EncodingContext ctx) throws EncodingException - Specified by:
encodein interfaceStreamingEncoder<org.apache.xmlbeans.XmlObject,Object> - Throws:
EncodingException
-
addNamespacePrefixToMap
- Specified by:
addNamespacePrefixToMapin interfaceSchemaAwareEncoder<org.apache.xmlbeans.XmlObject,Object>
-
encodeOmObservation
protected org.apache.xmlbeans.XmlObject encodeOmObservation(OmObservation sosObservation, EncodingContext context) throws EncodingException Method to create an O&M 2.0 observation XmlBeans object- Parameters:
sosObservation- SosObservation to be encodedcontext- Additional values which are used during the encoding- Returns:
- XmlBeans representation of O&M 2.0 observation
- Throws:
EncodingException- If an error occurs
-
setObservationType
protected void setObservationType(OmObservation observation, net.opengis.om.x20.OMObservationType xb) -
createNamedValue
protected net.opengis.om.x20.NamedValueType createNamedValue(NamedValue<?> sosNamedValue) throws EncodingException Method to encode a SOS NamedValue to an XmlBeans representation- Parameters:
sosNamedValue- SOS NamedValue- Returns:
- XmlBeans object
- Throws:
EncodingException- If an error occurs.
-
encodeXLINK
- Throws:
EncodingException
-
encodeXLINK
protected org.apache.xmlbeans.XmlObject encodeXLINK(Object o, EncodingContext context) throws EncodingException - Throws:
EncodingException
-
encodeGML
- Throws:
EncodingException
-
encodeGML
protected org.apache.xmlbeans.XmlObject encodeGML(Object o, EncodingContext context) throws EncodingException - Throws:
EncodingException
-
encodeSweCommon
- Throws:
EncodingException
-
encodeSweCommon
protected org.apache.xmlbeans.XmlObject encodeSweCommon(Object o, EncodingContext context) throws EncodingException - Throws:
EncodingException
-
encodeGWML
- Throws:
EncodingException
-
encodeGWML
protected org.apache.xmlbeans.XmlObject encodeGWML(Object o, EncodingContext context) throws EncodingException - Throws:
EncodingException
-