use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseResponsibleParty.
private OwsResponsibleParty parseResponsibleParty(ResponsiblePartySubsetType responsibleParty) {
if (responsibleParty == null) {
return null;
}
String positionName = responsibleParty.getPositionName();
String individualName = responsibleParty.getIndividualName();
String organisationName = null;
OwsContact contactInfo = parseContact(responsibleParty.getContactInfo());
OwsCode role = parseCode(responsibleParty.getRole());
return new OwsResponsibleParty(individualName, organisationName, positionName, contactInfo, role);
}
use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.
the class RelatedOfferingTypeDecoder method parseRelatedOffering.
private OfferingContext parseRelatedOffering(RelatedOffering relatedOffering) throws DecodingException {
ReferenceType role = decodeXmlElement(relatedOffering.getOfferingContext().getRole());
ReferenceType relOff = decodeXmlElement(relatedOffering.getOfferingContext().getRelatedOffering());
return new OfferingContext(role, relOff);
}
use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.
the class SamplingFeatureComplexTest method should_set_role_correct.
@Test
public void should_set_role_correct() {
final String role = "test-role";
final SamplingFeatureComplex sfc = new SamplingFeatureComplex(role, new SamplingFeature(new CodeWithAuthority("test-feature")));
assertThat(sfc.getRelatedSamplingFeatureRole(), is(role));
}
use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.
the class SamplingFeatureTest method isSetRelatedSamplingFeatures_should_return_false_if_not_set.
@Test
public final void isSetRelatedSamplingFeatures_should_return_false_if_not_set() {
final SamplingFeature feature = new SamplingFeature(null);
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
feature.addRelatedSamplingFeature(new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature"))));
assertThat(feature.isSetRelatedSamplingFeatures(), is(TRUE));
feature.setRelatedSamplingFeatures(null);
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
feature.setRelatedSamplingFeatures(Lists.<SamplingFeatureComplex>newArrayList());
assertThat(feature.isSetRelatedSamplingFeatures(), is(FALSE));
}
use of org.n52.shetland.iso.gco.Role in project arctic-sea by 52North.
the class SamplingFeatureTest method setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before.
@Test
public final void setRelatedSamplingFeatures_should_set_all_elements_and_reset_if_set_before() {
final SamplingFeature feature = new SamplingFeature(null);
final SamplingFeatureComplex relatedSamplingFeature = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature")));
final SamplingFeatureComplex relatedSamplingFeature2 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-2")));
List<SamplingFeatureComplex> list = Lists.newArrayList(relatedSamplingFeature, relatedSamplingFeature2);
feature.setRelatedSamplingFeatures(list);
validate(feature, relatedSamplingFeature, relatedSamplingFeature2);
final SamplingFeatureComplex relatedSamplingFeature3 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-3")));
final SamplingFeatureComplex relatedSamplingFeature4 = new SamplingFeatureComplex("test-role", new SamplingFeature(new CodeWithAuthority("test-feature-4")));
list = Lists.newArrayList(relatedSamplingFeature3, relatedSamplingFeature4);
feature.setRelatedSamplingFeatures(list);
validate(feature, relatedSamplingFeature3, relatedSamplingFeature4);
}
Aggregations