use of net.opengis.sensorml.x20.ClassifierListType.Classifier in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseClassification.
/**
* Parses the classification
*
* @param clpts
* XML classification
* @return SOS classification
*/
private List<SmlClassifier> parseClassification(final ClassifierListPropertyType[] clpts) {
final List<SmlClassifier> sosClassifiers = new ArrayList<>(clpts.length);
for (final ClassifierListPropertyType clpt : clpts) {
if (clpt.isSetClassifierList()) {
ClassifierListType clt = clpt.getClassifierList();
if (CollectionHelper.isNotNullOrEmpty(clt.getClassifierArray())) {
for (final Classifier c : clt.getClassifierArray()) {
if (c.getTerm() != null) {
final SmlClassifier smlClassifier = new SmlClassifier();
parseTerm(c.getTerm(), smlClassifier);
sosClassifiers.add(smlClassifier);
}
}
}
}
}
return sosClassifiers;
}
use of net.opengis.sensorml.x20.ClassifierListType.Classifier in project arctic-sea by 52North.
the class SensorMLEncoderv20 method createClassification.
/**
* Creates the classification section of the SensorML description.
*
* @param classifications
* SOS classifications
*
* @return XML Classification array
*/
private ClassifierListPropertyType[] createClassification(final List<SmlClassifier> classifications) {
ClassifierListPropertyType xbClassification = ClassifierListPropertyType.Factory.newInstance(getXmlOptions());
ClassifierListType xbClassifierList = xbClassification.addNewClassifierList();
classifications.forEach(classifier -> createTerm(xbClassifierList.addNewClassifier().addNewTerm(), classifier));
return new ClassifierListPropertyType[] { xbClassification };
}
Aggregations