예제 #1
0
 /**
  * Parses the characteristics
  *
  * @param characteristicsArray XML characteristics
  * @return SOS characteristics
  * @throws OwsExceptionReport * if an error occurs
  */
 private List<SmlCharacteristics> parseCharacteristics(
     final Characteristics[] characteristicsArray) throws OwsExceptionReport {
   final List<SmlCharacteristics> sosCharacteristicsList =
       new ArrayList<SmlCharacteristics>(characteristicsArray.length);
   final SmlCharacteristics sosCharacteristics = new SmlCharacteristics();
   for (final Characteristics xbCharacteristics : characteristicsArray) {
     final Object decodedObject =
         CodingHelper.decodeXmlElement(xbCharacteristics.getAbstractDataRecord());
     if (decodedObject instanceof DataRecord) {
       sosCharacteristics.setDataRecord((DataRecord) decodedObject);
     } else {
       throw new InvalidParameterValueException()
           .at(XmlHelper.getLocalName(xbCharacteristics))
           .withMessage(
               "Error while parsing the characteristics of the SensorML (the characteristics' data record is not of type DataRecordPropertyType)!");
     }
   }
   sosCharacteristicsList.add(sosCharacteristics);
   return sosCharacteristicsList;
 }