use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.
the class SweDataRecordTest method getFieldIndexByIdentifier_should_not_fail_on_bad_input.
@Test
public void getFieldIndexByIdentifier_should_not_fail_on_bad_input() {
final SweDataRecord dataRecord = new SweDataRecord();
dataRecord.addField(new SweField("identifier", new SweBoolean()));
final SweBoolean b = new SweBoolean();
b.setDefinition("test-element-definition");
dataRecord.addField(new SweField("test-field-name", b));
assertThat(dataRecord.getFieldIndexByIdentifier(null), is(-1));
assertThat(dataRecord.getFieldIndexByIdentifier(""), is(-1));
}
use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.
the class UVFEncoder method getFilename.
private String getFilename(List<OmObservation> observations) {
Set<String> identifiers = new HashSet<>();
for (OmObservation o : observations) {
if (o.getObservationConstellation().isSetIdentifier()) {
identifiers.add(o.getObservationConstellation().getIdentifier());
}
}
StringBuffer pathBuffer = new StringBuffer();
if (!identifiers.isEmpty()) {
for (String identifier : identifiers) {
pathBuffer.append(identifier).append("_");
}
pathBuffer.replace(pathBuffer.lastIndexOf("_"), pathBuffer.length(), "");
} else {
pathBuffer.append("_").append(Long.toString(java.lang.System.nanoTime()));
}
pathBuffer.append(".uvf");
return pathBuffer.toString();
}
use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.
the class FieldDecoderTest method checkCommon.
protected SweField checkCommon(ObjectNode json, boolean withValue) throws DecodingException {
SweField field = validateWithValueAndDecode(json, withValue);
assertThat(field, is(notNullValue()));
errors.checkThat(field.getName().getValue(), is(NAME));
assertThat(field.getElement(), is(notNullValue()));
errors.checkThat(field.getElement().getDefinition(), is(DEFINITION));
errors.checkThat(field.getElement().getDescription(), is(DESCRIPTION));
errors.checkThat(field.getElement().getIdentifier(), is(IDENTIFIER));
errors.checkThat(field.getElement().getLabel(), is(LABEL));
return field;
}
use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseIdentifications.
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());
}
}
}
}
}
}
use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.
the class SpecimenDecoderv20 method parseSpatialSamplingFeature.
private AbstractFeature parseSpatialSamplingFeature(final SFSpecimenType sfst) throws DecodingException {
final SfSpecimen specimen = new SfSpecimen(null, sfst.getId());
// parse identifier, names, description
parseAbstractFeatureType(sfst, specimen);
specimen.setSampledFeatures(getSampledFeatures(sfst.getSampledFeatureArray()));
specimen.setXml(getXmlDescription(sfst));
if (sfst.getParameterArray() != null) {
specimen.setParameters(parseNamedValueTypeArray(sfst.getParameterArray()));
}
// TODO
sfst.getMaterialClass();
specimen.setMaterialClass((ReferenceType) decodeXmlElement(sfst.getMaterialClass()));
specimen.setSamplingTime(getSamplingTime(sfst));
// samplingLocation
if (sfst.isSetSamplingLocation()) {
specimen.setSamplingLocation(getGeometry(sfst));
}
// sfst.getProcessingDetailsArray();
if (sfst.isSetSize()) {
specimen.setSize(getSize(sfst.getSize()));
}
// }
if (sfst.isSetSpecimenType()) {
specimen.setSpecimenType((ReferenceType) decodeXmlElement(sfst.getSpecimenType()));
}
return specimen;
}
Aggregations