com.biocomfort.TO.data_consumer
Class RestWeightMeasurementProcessor
java.lang.Object
com.biocomfort.TO.data_consumer.RestMeasurementProcessor
com.biocomfort.TO.data_consumer.RestWeightMeasurementProcessor
- All Implemented Interfaces:
- MeasurementProcessor
public class RestWeightMeasurementProcessor
- extends RestMeasurementProcessor
Extends the class RestMeasurementProcessor and defines the
concrete transformation of measurement data of body diagnostic scale
into XML strings. Also the URL path postfix of the restful web service
to which the measurement data will be send is defined by this class. By
default it is defined as "body_weight_measurements".
The weight measurement data is transformed into the following XML
format:
<?xml version="1.0" encoding="UTF-8"?>
<body-weight-measurement>
<manually-entered type="boolean">false</manually-entered>
<timestamp type="datetime">2008-05-13T12:00:00+00:00</timestamp>
<user-id type="integer">1</user-id>
<weight>
<value type="decimal">80.0</value>
</weight>
<impedance>
<value type="decimal">600.0</value>
</impedance>
<body-fat>
<value type="decimal">20.0</value>
</body-fat>
<body-water>
<value type="decimal">60.0</value>
</body-water>
<muscle-mass>
<value type="decimal">22.0</value>
</muscle-mass>
</body-weight-measurement>
Constructor Summary |
RestWeightMeasurementProcessor(java.lang.String urlPath)
Constructs a RestWeightMeasurementProcessor
object with specifying the URL path by the given parameter
urlPath. |
Method Summary |
protected java.lang.String |
transformDataToXmlString(TO data)
Returns a String object that represents the given weight
measurement data, formated as a valid XML document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RestWeightMeasurementProcessor
public RestWeightMeasurementProcessor(java.lang.String urlPath)
- Constructs a
RestWeightMeasurementProcessor
object with specifying the URL path by the given parameter
urlPath.
- Parameters:
urlPath
- the URL path
transformDataToXmlString
protected java.lang.String transformDataToXmlString(TO data)
- Returns a String object that represents the given weight
measurement data, formated as a valid XML document. See above for
more details.
- Specified by:
transformDataToXmlString
in class RestMeasurementProcessor
- Parameters:
data
- the received measurement data
- Returns:
- a string representation of the weight measurement formated
as XML
- See Also:
RestMeasurementProcessor.getXMLDateFormat()
,
RestMeasurementProcessor.getXMLStringFromDocument(Document)