Collection<SpecificationLink> slcol = serviceBinding.getSpecificationLinks();
TModelInstanceDetails tid = objectFactory.createTModelInstanceDetails();
if (slcol != null && !slcol.isEmpty()) {
Iterator<SpecificationLink> iter = slcol.iterator();
while (iter.hasNext()) {
SpecificationLink slink = (SpecificationLink) iter.next();
TModelInstanceInfo emptyTInfo = objectFactory.createTModelInstanceInfo();
tid.getTModelInstanceInfo().add(emptyTInfo);
RegistryObject specificationObject = slink.getSpecificationObject();
if (specificationObject.getKey() != null && specificationObject.getKey().getId() != null) {
emptyTInfo.setTModelKey(specificationObject.getKey().getId());
if (specificationObject.getDescription()!=null) {
for (Object o : specificationObject.getDescription().getLocalizedStrings()) {
LocalizedString locDesc = (LocalizedString) o;
Description description = objectFactory.createDescription();
emptyTInfo.getDescription().add(description);
description.setValue(locDesc.getValue());
description.setLang(locDesc.getLocale().getLanguage());
}
}
Collection<ExternalLink> externalLinks = slink.getExternalLinks();
if (externalLinks!=null && externalLinks.size()>0) {
for (ExternalLink link : externalLinks) {
InstanceDetails ids = objectFactory.createInstanceDetails();
emptyTInfo.setInstanceDetails(ids);
if (link.getDescription()!=null) {
Description description = objectFactory.createDescription();
ids.getDescription().add(description);
description.setValue(link.getDescription().getValue());
}
if (link.getExternalURI()!=null) {
OverviewDoc overviewDoc = objectFactory.createOverviewDoc();
ids.getOverviewDoc().add(overviewDoc);
org.uddi.api_v3.OverviewURL ourl = new org.uddi.api_v3.OverviewURL();
ourl.setValue(link.getExternalURI());
overviewDoc.setOverviewURL(ourl);
}
if (slink.getUsageParameters() != null) {
StringBuffer buffer = new StringBuffer();
for (Object o : slink.getUsageParameters()) {
String s = (String) o;
buffer.append(s + " ");
}
ids.setInstanceParms(buffer.toString().trim());
}