use of org.n52.shetland.w3c.xlink.Show in project arctic-sea by 52North.
the class GmlEncoderv321 method addAbstractCRSValues.
private void addAbstractCRSValues(AbstractCRSType acrst, AbstractCRS abstractCRS) throws EncodingException {
addDefinitonValues(acrst, abstractCRS);
if (abstractCRS.hasDomainOfValidity()) {
for (Referenceable<DomainOfValidity> domainOfValidity : abstractCRS.getDomainOfValidity()) {
net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity dov = acrst.addNewDomainOfValidity();
if (domainOfValidity.isReference()) {
Reference reference = domainOfValidity.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(dov::setActuate);
reference.getArcrole().ifPresent(dov::setArcrole);
reference.getHref().map(URI::toString).ifPresent(dov::setHref);
reference.getRole().ifPresent(dov::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(dov::setShow);
reference.getTitle().ifPresent(dov::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(dov::setType);
} else {
if (domainOfValidity.isInstance()) {
Nillable<DomainOfValidity> nillable = domainOfValidity.getInstance();
if (nillable.isPresent()) {
net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity xml = createDomainOfValidity(nillable.get(), EncodingContext.empty());
if (xml != null) {
dov.set(xml);
} else {
dov.setNil();
dov.setNilReason(Nillable.missing().get());
}
} else {
dov.setNil();
if (nillable.hasReason()) {
dov.setNilReason(nillable.getNilReason().get());
} else {
dov.setNilReason(Nillable.missing().get());
}
}
}
}
}
}
if (abstractCRS.hasScope()) {
abstractCRS.getScope().forEach(scope -> acrst.addNewScope().setStringValue(scope));
}
}
use of org.n52.shetland.w3c.xlink.Show in project arctic-sea by 52North.
the class AbstractWmlEncoderv20 method addVerticalDatum.
private void addVerticalDatum(MonitoringPointType mpt, List<Referenceable<VerticalDatum>> verticalDatums) throws EncodingException {
for (Referenceable<VerticalDatum> verticalDatum : verticalDatums) {
VerticalDatumPropertyType vdpt = mpt.addNewVerticalDatum();
if (verticalDatum.isReference()) {
Reference reference = verticalDatum.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(vdpt::setActuate);
reference.getArcrole().ifPresent(vdpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(vdpt::setHref);
reference.getRole().ifPresent(vdpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(vdpt::setShow);
reference.getTitle().ifPresent(vdpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(vdpt::setType);
} else {
if (verticalDatum.isInstance()) {
Nillable<VerticalDatum> nillable = verticalDatum.getInstance();
if (nillable.isPresent()) {
XmlObject xml = encodeGML(nillable.get());
if (xml != null && xml instanceof VerticalDatumType) {
vdpt.setVerticalDatum((VerticalDatumType) xml);
} else {
vdpt.setNil();
vdpt.setNilReason(Nillable.missing().get());
}
} else {
vdpt.setNil();
if (nillable.hasReason()) {
vdpt.setNilReason(nillable.getNilReason().get());
} else {
vdpt.setNilReason(Nillable.missing().get());
}
}
}
}
}
}
use of org.n52.shetland.w3c.xlink.Show in project arctic-sea by 52North.
the class AbstractWmlEncoderv20 method addRelatedParty.
private void addRelatedParty(MonitoringPointType mpt, List<Referenceable<CiResponsibleParty>> relatedParties) throws EncodingException {
for (Referenceable<CiResponsibleParty> relatedParty : relatedParties) {
CIResponsiblePartyPropertyType citppt = mpt.addNewRelatedParty();
if (relatedParty.isReference()) {
Reference reference = relatedParty.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(citppt::setActuate);
reference.getArcrole().ifPresent(citppt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(citppt::setHref);
reference.getRole().ifPresent(citppt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(citppt::setShow);
reference.getTitle().ifPresent(citppt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(citppt::setType);
} else {
if (relatedParty.isInstance()) {
Nillable<CiResponsibleParty> nillable = relatedParty.getInstance();
if (nillable.isPresent()) {
XmlObject xml = encodeObjectToXml(nillable.get().getDefaultElementEncoding(), nillable.get());
if (xml != null && xml instanceof CIResponsiblePartyType) {
citppt.setCIResponsibleParty((CIResponsiblePartyType) xml);
} else {
citppt.setNil();
citppt.setNilReason(Nillable.missing().get());
}
} else {
citppt.setNil();
if (nillable.hasReason()) {
citppt.setNilReason(nillable.getNilReason().get());
} else {
citppt.setNilReason(Nillable.missing().get());
}
}
}
}
}
}
use of org.n52.shetland.w3c.xlink.Show in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseRequestMethod.
private OwsRequestMethod parseRequestMethod(String httpMethod, RequestMethodType method) {
if (method == null) {
return null;
}
URI href = Optional.ofNullable(method.getHref()).map(Strings::emptyToNull).map(URI::create).orElse(null);
URI role = Optional.ofNullable(method.getRole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
URI arcrole = Optional.ofNullable(method.getArcrole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
Show show = Optional.ofNullable(method.getShow()).map(Object::toString).map(Show::valueOf).orElse(null);
Actuate actuate = Optional.ofNullable(method.getActuate()).map(Object::toString).map(Actuate::valueOf).orElse(null);
String title = method.getTitle();
List<OwsDomain> constraints = parseDomains(method.getConstraintArray());
return new OwsRequestMethod(href, constraints, httpMethod, role, arcrole, title, show, actuate);
}
use of org.n52.shetland.w3c.xlink.Show in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodePhone.
private void encodePhone(CITelephonePropertyType citpt, Referenceable<CiTelephone> referenceable) {
if (referenceable.isReference()) {
Reference reference = referenceable.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(citpt::setActuate);
reference.getArcrole().ifPresent(citpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(citpt::setHref);
reference.getRole().ifPresent(citpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(citpt::setShow);
reference.getTitle().ifPresent(citpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(citpt::setType);
} else {
if (referenceable.isInstance()) {
Nillable<CiTelephone> nillable = referenceable.getInstance();
if (nillable.isPresent()) {
CiTelephone ciTelephone = referenceable.getInstance().get();
CITelephoneType citt = citpt.addNewCITelephone();
if (ciTelephone.isSetVoice()) {
citt.setVoiceArray(listToCharacterStringPropertyTypeArray(ciTelephone.getVoice()));
}
if (ciTelephone.isSetFacsimile()) {
citt.setFacsimileArray(listToCharacterStringPropertyTypeArray(ciTelephone.getFacsimile()));
}
if (ciTelephone.isSetId()) {
citt.setId(ciTelephone.getId());
}
if (ciTelephone.isSetUuid()) {
citt.setUuid(ciTelephone.getUuid());
}
} else {
if (nillable.hasReason()) {
citpt.setNilReason(nillable.getNilReason().get());
}
}
}
}
}
Aggregations