use of org.isotc211.x2005.gmd.CIOnlineResourceType in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeOnlineResource.
private void encodeOnlineResource(CIOnlineResourcePropertyType ciorpt, Referenceable<CiOnlineResource> referenceable) {
if (referenceable.isReference()) {
Reference reference = referenceable.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(ciorpt::setActuate);
reference.getArcrole().ifPresent(ciorpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(ciorpt::setHref);
reference.getRole().ifPresent(ciorpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(ciorpt::setShow);
reference.getTitle().ifPresent(ciorpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(ciorpt::setType);
} else {
if (referenceable.isInstance()) {
Nillable<CiOnlineResource> nillable = referenceable.getInstance();
if (nillable.isPresent()) {
CIOnlineResourceType ciort = ciorpt.addNewCIOnlineResource();
encodeOnlineResource(ciort, referenceable.getInstance().get());
} else {
if (nillable.hasReason()) {
ciorpt.setNilReason(nillable.getNilReason().get());
}
}
}
}
}
use of org.isotc211.x2005.gmd.CIOnlineResourceType in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeCiOnlineResource.
private XmlObject encodeCiOnlineResource(CiOnlineResource element, EncodingContext context) {
CIOnlineResourceType ciort = CIOnlineResourceType.Factory.newInstance(getXmlOptions());
encodeOnlineResource(ciort, element);
if (context.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
CIOnlineResourcePropertyType ciorpt = CIOnlineResourcePropertyType.Factory.newInstance(getXmlOptions());
ciorpt.setCIOnlineResource(ciort);
return ciorpt;
} else if (context.has(XmlBeansEncodingFlags.DOCUMENT)) {
CIOnlineResourceDocument ciord = CIOnlineResourceDocument.Factory.newInstance(getXmlOptions());
ciord.setCIOnlineResource(ciort);
return ciord;
}
return ciort;
}
Aggregations