private void parseComment(ObservationProcessType opt, ObservationProcess observationProcess) { if (CollectionHelper.isNotNullOrEmpty(opt.getCommentArray())) { observationProcess.setComments(Lists.newArrayList(opt.getCommentArray())); } }
private void clearAbstracts(ServiceIdentification serviceIdent) { if (CollectionHelper.isNotNullOrEmpty(serviceIdent.getAbstractArray())) { for (int i = 0; i < serviceIdent.getAbstractArray().length; i++) { serviceIdent.removeAbstract(i); } } }
private void parseInput(ObservationProcessType opt, ObservationProcess observationProcess) { if (CollectionHelper.isNotNullOrEmpty(opt.getInputArray())) { parseReferenceType(opt.getInputArray()); } }
private void clearTitles(ServiceIdentification serviceIdent) { if (CollectionHelper.isNotNullOrEmpty(serviceIdent.getTitleArray())) { for (int i = 0; i < serviceIdent.getTitleArray().length; i++) { serviceIdent.removeTitle(i); } } }
private List<SmlIo<?>> parseInputs(Inputs inputs) throws OwsExceptionReport { if (CollectionHelper.isNotNullOrEmpty(inputs.getInputList().getInputArray())) { final List<SmlIo<?>> sosInputs = new ArrayList<SmlIo<?>>(inputs.getInputList().getInputArray().length); for (final Input xbInput : inputs.getInputList().getInputArray()) { sosInputs.add(parseInput(xbInput)); } return sosInputs; } return Collections.emptyList(); }
private List<SmlIo<?>> parseOutputs(Outputs outputs) throws OwsExceptionReport { if (CollectionHelper.isNotNullOrEmpty(outputs.getOutputList().getOutputArray())) { final List<SmlIo<?>> sosOutputs = new ArrayList<SmlIo<?>>(outputs.getOutputList().getOutputArray().length); for (final Output xbOutput : outputs.getOutputList().getOutputArray()) { sosOutputs.add(parseOutput(xbOutput)); } return sosOutputs; } return Collections.emptyList(); }
private void decodePhone(CITelephoneType citt, SmlResponsibleParty responsibleParty) { if (CollectionHelper.isNotNullOrEmpty(citt.getVoiceArray())) { responsibleParty.setPhoneVoice(characterStringPropertyTypeArrayToList(citt.getVoiceArray())); } if (CollectionHelper.isNotNullOrEmpty(citt.getFacsimileArray())) { responsibleParty.setPhoneFax(characterStringPropertyTypeArrayToList(citt.getFacsimileArray())); } }
private void parseAbstractPhysicalProcess(AbstractPhysicalProcessType appt, AbstractPhysicalProcess abstractPhysicalProcess) throws OwsExceptionReport { if (appt.isSetAttachedTo()) { Object decodeXmlElement = CodingHelper.decodeXmlElement(appt.getAttachedTo()); if (decodeXmlElement != null && decodeXmlElement instanceof ReferenceType) { abstractPhysicalProcess.setAttachedTo((ReferenceType) decodeXmlElement); } } if (CollectionHelper.isNotNullOrEmpty(appt.getLocalReferenceFrameArray())) { } if (CollectionHelper.isNotNullOrEmpty(appt.getLocalTimeFrameArray())) { } if (CollectionHelper.isNotNullOrEmpty(appt.getPositionArray())) { for (PositionUnionPropertyType pupt : appt.getPositionArray()) { abstractPhysicalProcess.setPosition(parsePositionFrom(pupt)); // TODO remove break if AbstractPhysicalProcess is extended break; } } if (CollectionHelper.isNotNullOrEmpty(appt.getTimePositionArray())) { } }
@SuppressWarnings({ "unchecked", "rawtypes" }) private SweAllowedValues parseAllowedValues(AllowedValues avt) { SweAllowedValues allowedValues = new SweAllowedValues(); if (avt.isSetId()) { allowedValues.setGmlId(avt.getId()); } if (CollectionHelper.isNotNullOrEmpty(avt.getValueListArray())) { for (List list : avt.getValueListArray()) { if (CollectionHelper.isNotEmpty(list)) { for (Object value : list) { allowedValues.addValue(Double.parseDouble(value.toString())); } } } } if (CollectionHelper.isNotNullOrEmpty(avt.getIntervalArray())) { for (List interval : avt.getIntervalArray()) { RangeValue<Double> rangeValue = new RangeValue<Double>(); Iterator<Double> iterator = interval.iterator(); if (iterator.hasNext()) { rangeValue.setRangeStart(iterator.next()); } if (iterator.hasNext()) { rangeValue.setRangeEnd(iterator.next()); } allowedValues.addInterval(rangeValue); } } return allowedValues; }
private void parseParameter(ObservationProcessType opt, ObservationProcess observationProcess) throws OwsExceptionReport { if (CollectionHelper.isNotNullOrEmpty(opt.getParameterArray())) { observationProcess.setParameters(parseNamedValueTypeArray(opt.getParameterArray())); } checkForOffering(observationProcess); }
@SuppressWarnings({ "unchecked", "rawtypes" }) private SweAllowedTimes parseAllowedTimes(AllowedTimes att) throws DateTimeParseException { SweAllowedTimes allowedTimes = new SweAllowedTimes(); if (att.isSetId()) { allowedTimes.setGmlId(att.getId()); } if (CollectionHelper.isNotNullOrEmpty(att.getValueListArray())) { for (List list : att.getValueListArray()) { if (CollectionHelper.isNotEmpty(list)) { for (Object value : list) { allowedTimes.addValue(DateTimeHelper.parseIsoString2DateTime(value.toString())); } } } } if (CollectionHelper.isNotNullOrEmpty(att.getIntervalArray())) { for (List interval : att.getIntervalArray()) { RangeValue<DateTime> rangeValue = new RangeValue<DateTime>(); Iterator iterator = interval.iterator(); if (iterator.hasNext()) { rangeValue.setRangeStart(DateTimeHelper.parseIsoString2DateTime(iterator.next().toString())); } if (iterator.hasNext()) { rangeValue.setRangeEnd(DateTimeHelper.parseIsoString2DateTime(iterator.next().toString())); } allowedTimes.addInterval(rangeValue); } } return allowedTimes; }
/** * Parses the classification * * @param classificationArray * XML classification * @return SOS classification */ private List<SmlClassifier> parseClassification(final ClassifierListPropertyType[] clpts) { final List<SmlClassifier> sosClassifiers = new ArrayList<SmlClassifier>(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; }
private List<SmlContact> parseContact(final ContactListPropertyType[] clpts) throws OwsExceptionReport { List<SmlContact> smlContacts = Lists.newArrayList(); for (ContactListPropertyType clpt : clpts) { if (clpt.isSetContactList() && CollectionHelper.isNotNullOrEmpty(clpt.getContactList().getContactArray())) { for (CIResponsiblePartyPropertyType c : clpt.getContactList().getContactArray()) { final Object o = CodingHelper.decodeXmlElement(c); if (o instanceof SmlContact) { smlContacts.add((SmlContact) o); } else { throw new InvalidParameterValueException().at(XmlHelper.getLocalName(c)) .withMessage("Error while parsing the contacts of " + "the SensorML!"); } } } } return smlContacts; }
private void parseFeatureOfInterest(FeaturesOfInterest featuresOfInterest, AbstractProcessV20 abstractProcess) throws OwsExceptionReport { if (CollectionHelper.isNotNullOrEmpty(featuresOfInterest.getFeatureList().getFeatureArray())) { SmlFeatureOfInterest smlFeatureOfInterest = new SmlFeatureOfInterest(); for (FeaturePropertyType fpt : featuresOfInterest.getFeatureList().getFeatureArray()) { Object o = CodingHelper.decodeXmlElement(fpt); if (o instanceof AbstractFeature) { smlFeatureOfInterest.addFeatureOfInterest((AbstractFeature) o); } } abstractProcess.setSmlFeatureOfInterest(smlFeatureOfInterest); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) private SweAllowedTokens parseAllowedTokens(AllowedTokens att) { SweAllowedTokens allowedTokens = new SweAllowedTokens(); if (att.isSetId()) { allowedTokens.setGmlId(att.getId()); } if (CollectionHelper.isNotNullOrEmpty(att.getValueListArray())) { for (List list : att.getValueListArray()) { if (CollectionHelper.isNotEmpty(list)) { allowedTokens.setValue(list); } } } return allowedTokens; }
private InsertFeatureOfInterestRequest parseInsertFeatureOfInterest(InsertFeatureOfInterestDocument ifoid) throws OwsExceptionReport { InsertFeatureOfInterestRequest request = null; InsertFeatureOfInterestType ifoit = ifoid.getInsertFeatureOfInterest(); if (ifoit != null) { request = new InsertFeatureOfInterestRequest(); request.setVersion(ifoit.getVersion()); request.setService(ifoit.getService()); if (CollectionHelper.isNotNullOrEmpty(ifoit.getFeatureMemberArray())) { parseFeatureMember(ifoit, request); } } else { throw new NoApplicableCodeException() .withMessage("Received XML document is not valid. Set log level to debug to get more details"); } return request; }
private void parseIdentifications(DescribedObject describedObject, IdentifierListPropertyType[] identificationArray) { for (final IdentifierListPropertyType ilpt : identificationArray) { if (ilpt.isSetIdentifierList() && CollectionHelper.isNotNullOrEmpty(ilpt.getIdentifierList().getIdentifier2Array())) { for (final Identifier i : ilpt.getIdentifierList().getIdentifier2Array()) { if (i.getTerm() != null) { final SmlIdentifier identifier = new SmlIdentifier(); parseTerm(i.getTerm(), identifier); describedObject.addIdentifier(identifier); if (isIdentificationProcedureIdentifier(identifier)) { describedObject.setIdentifier(identifier.getValue()); } } } } } }
if (clpt.isSetCharacteristicList()) { CharacteristicListType clt = clpt.getCharacteristicList(); if (CollectionHelper.isNotNullOrEmpty(clt.getCharacteristicArray())) { for (Characteristic c : clt.getCharacteristicArray()) { final SmlCharacteristic characteristic = new SmlCharacteristic(c.getName());
private void parseAbstractProcess(AbstractProcessType apt, AbstractProcessV20 abstractProcess) throws OwsExceptionReport { if (apt.isSetTypeOf()) { Object decodedElement = CodingHelper.decodeXmlElement(apt.getTypeOf()); if (decodedElement instanceof ReferenceType) { abstractProcess.setTypeOf((ReferenceType)decodedElement); } } if (apt.isSetConfiguration()) { } if (apt.isSetFeaturesOfInterest()) { parseFeatureOfInterest(apt.getFeaturesOfInterest(), abstractProcess); } if (apt.isSetInputs()) { abstractProcess.setInputs(parseInputs(apt.getInputs())); } if (apt.isSetOutputs()) { abstractProcess.setOutputs(parseOutputs(apt.getOutputs())); } if (CollectionHelper.isNotNullOrEmpty(apt.getModesArray())) { } }
if (cs.isSetCapabilityList()) { CapabilityListType cl = cs.getCapabilityList(); if (CollectionHelper.isNotNullOrEmpty(cl.getCapabilityArray())) { for (Capability c : cl.getCapabilityArray()) { final SmlCapability capability = new SmlCapability(c.getName());