Package org.n52.svalbard.encode
Class AbstractOmEncoderv20
- java.lang.Object
-
- org.n52.svalbard.encode.AbstractDelegatingEncoder<T,S>
-
- 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 Constructor Description AbstractOmEncoderv20()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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 booleanconvertEncodedProcedure()Indicator 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.OMObservationTypecreateOmObservationType()protected 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.XmlObjectencodeGML(Object o)protected 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.XmlObjectencodeSweCommon(Object o)protected org.apache.xmlbeans.XmlObjectencodeSweCommon(Object o, EncodingContext context)protected org.apache.xmlbeans.XmlObjectencodeXLINK(Object o)protected org.apache.xmlbeans.XmlObjectencodeXLINK(Object o, EncodingContext context)abstract StringgetDefaultFeatureEncodingNamespace()Get the default encoding Namespace for FeatureOfInterestprotected abstract StringgetDefaultProcedureEncodingNamspace()Get 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, 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
encode, getContentType, getSupportedTypes
-
Methods inherited from interface org.n52.svalbard.encode.ObservationEncoder
getProcedureEncodingNamspace, getSupportedResponseFormatObservationTypes, getSupportedResponseFormats, getSupportedResponseFormats, isObservationAndMeasurmentV20Type, shouldObservationsWithSameXBeMerged, supportsResultStreamingForMergedValues
-
Methods inherited from interface org.n52.svalbard.encode.SchemaAwareEncoder
getSchemaLocations
-
Methods inherited from interface org.n52.svalbard.encode.StreamingEncoder
encode
-
-
-
-
Method Detail
-
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
public abstract String getDefaultFeatureEncodingNamespace()
Get the default encoding Namespace for FeatureOfInterest- Returns:
- Encoding namespace
-
getDefaultProcedureEncodingNamspace
protected abstract String 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
public void addNamespacePrefixToMap(Map<String,String> nameSpacePrefixMap)
- 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
protected org.apache.xmlbeans.XmlObject encodeXLINK(Object o) throws EncodingException
- Throws:
EncodingException
-
encodeXLINK
protected org.apache.xmlbeans.XmlObject encodeXLINK(Object o, EncodingContext context) throws EncodingException
- Throws:
EncodingException
-
encodeGML
protected org.apache.xmlbeans.XmlObject encodeGML(Object o) throws EncodingException
- Throws:
EncodingException
-
encodeGML
protected org.apache.xmlbeans.XmlObject encodeGML(Object o, EncodingContext context) throws EncodingException
- Throws:
EncodingException
-
encodeSweCommon
protected org.apache.xmlbeans.XmlObject encodeSweCommon(Object o) throws EncodingException
- Throws:
EncodingException
-
encodeSweCommon
protected org.apache.xmlbeans.XmlObject encodeSweCommon(Object o, EncodingContext context) throws EncodingException
- Throws:
EncodingException
-
encodeGWML
protected org.apache.xmlbeans.XmlObject encodeGWML(Object o) throws EncodingException
- Throws:
EncodingException
-
encodeGWML
protected org.apache.xmlbeans.XmlObject encodeGWML(Object o, EncodingContext context) throws EncodingException
- Throws:
EncodingException
-
-