CategoryBag cbag = objectFactory.createCategoryBag();
Iterator classiter = classifications.iterator();
while (classiter.hasNext()) {
Classification classification = (Classification) classiter.next();
if (classification != null ) {
KeyedReference keyr = objectFactory.createKeyedReference();
cbag.getKeyedReference().add(keyr);
InternationalStringImpl iname = null;
String value = null;
ClassificationScheme scheme = classification.getClassificationScheme();
if (scheme==null || (classification.isExternal() && classification.getConcept()==null)) {
/*
* JAXR 1.0 Specification: Section D6.4.4
* Specification related tModels mapped from Concept may be automatically
* categorized by the well-known uddi-org:types taxonomy in UDDI (with
* tModelKey uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4) as follows:
* The keyed reference is assigned a taxonomy value of specification.
*/
keyr.setTModelKey(UDDI_ORG_TYPES);
keyr.setKeyValue("specification");
} else {
if (classification.isExternal()) {
iname = (InternationalStringImpl) ((RegistryObject) classification).getName();
value = classification.getValue();
} else {
Concept concept = classification.getConcept();
if (concept != null) {
iname = (InternationalStringImpl) ((RegistryObject) concept).getName();
value = concept.getValue();
scheme = concept.getClassificationScheme();
}
}
String name = iname.getValue();
if (name != null)
keyr.setKeyName(name);
if (value != null)
keyr.setKeyValue(value);
if (scheme != null) {
Key key = scheme.getKey();
if (key != null && key.getId() != null)
keyr.setTModelKey(key.getId());
}
}
}
}
return cbag;