QName type,
CorbaType obj,
CorbaTypeMap typeMap,
Stack<QName> seenTypes) {
if (type == null) {
throw new CorbaBindingException("corba:typemap type or elemtype information required"
+ (obj == null ? "" : " for " + obj)
+ (seenTypes.empty() ? "" : ", Enclosing type: " + seenTypes.elementAt(0)));
}
TypeCode tc = null;
// first see if it is a primitive
tc = getPrimitiveTypeCode(orb, type);
if (tc == null && type.equals(CorbaConstants.NT_CORBA_ANY)) {
// Anys are handled in a special way
tc = orb.get_primitive_tc(TCKind.from_int(TCKind._tk_any));
} else if (tc == null) {
if (typeMap == null) {
throw new CorbaBindingException("Unable to locate typemap for namespace \""
+ type.getNamespaceURI() + "\"");
}
tc = typeMap.getTypeCode(type);
if (tc == null) {
if (obj == null) {
obj = typeMap.getType(type.getLocalPart());
if (obj == null) {
throw new CorbaBindingException("Unable to locate object definition");
}
}
tc = getComplexTypeCode(orb, type, obj, typeMap, seenTypes);
if (tc != null) {
typeMap.addTypeCode(type, tc);
}
}
}
if (tc == null) {
throw new CorbaBindingException("Corba type node with qname " + type + " is not supported");
}
return tc;
}