use of net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList in project arctic-sea by 52North.
the class SensorMLEncoderv101 method createClassification.
/**
* Creates the classification section of the SensorML description.
*
* @param classifications
* SOS classifications
*
* @return XML Classification array
*/
private Classification[] createClassification(List<SmlClassifier> classifications) {
Classification xbClassification = Classification.Factory.newInstance(getXmlOptions());
ClassifierList xbClassifierList = xbClassification.addNewClassifierList();
classifications.forEach(sosSMLClassifier -> {
Classifier xbClassifier = xbClassifierList.addNewClassifier();
if (sosSMLClassifier.getName() != null) {
xbClassifier.setName(sosSMLClassifier.getName());
}
Term xbTerm = xbClassifier.addNewTerm();
xbTerm.setValue(sosSMLClassifier.getValue());
if (sosSMLClassifier.isSetDefinition()) {
xbTerm.setDefinition(sosSMLClassifier.getDefinition());
}
if (sosSMLClassifier.isSetCodeSpace()) {
xbTerm.addNewCodeSpace().setHref(sosSMLClassifier.getCodeSpace());
}
});
return new Classification[] { xbClassification };
}
Aggregations