}
public static TModel getTModelFromJAXRConcept(Concept scheme)
throws JAXRException
{
TModel tm = new TModel();
if(scheme == null ) return null;
try
{
Key key = scheme.getKey();
if(key != null) tm.setTModelKey(key.getId());
Slot sl1 = scheme.getSlot("authorizedName");
if( sl1 != null ) tm.setAuthorizedName(sl1.getName());
Slot sl2 = scheme.getSlot("operator");
if( sl2 != null ) tm.setOperator(sl2.getName());
InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) scheme).getName();
String name = iname.getValue();
tm.setName(new Name(name, Locale.getDefault().getLanguage()));
tm.addDescription(new Description( scheme.getDescription().getValue()));
//External Links
Collection externalLinks = scheme.getExternalLinks();
if(externalLinks != null && externalLinks.size() > 0)
{
tm.setOverviewDoc(getOverviewDocFromExternalLink((ExternalLink)externalLinks.iterator().next()));
}
//External Identifiers
IdentifierBag idBag = new IdentifierBag();
idBag.setKeyedReferenceVector(getKeyedReferenceVector(scheme.getExternalIdentifiers()));
tm.setIdentifierBag(idBag);
//Classifications
Collection classifications = scheme.getClassifications();
if(classifications != null && classifications.isEmpty() == false)
{
//Spec says from Concept, always assume the uddi-org:types
tm.setCategoryBag(getCategoryBagFromConcept());
}
} catch (Exception ud)
{
throw new JAXRException("Apache JAXR Impl:", ud);
}