}
return null;
}
public static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes) {
CorbaTypeMap map = null;
if (tmTypes != null) {
//Currently, only one type map
TypeMappingType tmType = tmTypes.get(0);
map = new CorbaTypeMap(tmType.getTargetNamespace());
List<CorbaTypeImpl> types = tmType.getStructOrExceptionOrUnion();
LOG.fine("Found " + types.size() + " types defined in the typemap");
for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
CorbaTypeImpl corbaType = it.next();
String name = corbaType.getName();
// There can be some instances where a prefix is added to the name by the tool
// (e.g. Object Reference Names). Since the name is read as a string, this
// prefix is added to the types name. Remove this as it is not needed.
int pos = name.lastIndexOf(":");
if (pos != -1) {
name = name.substring(pos + 1);
corbaType.setName(name);
}
map.addType(name, corbaType);
LOG.fine("Adding type " + name);
}
}
return map;
}