Set mappedTypeQNames = new HashSet();
JavaXmlTypeMappingType[] javaXmlTypeMappings = mapping.getJavaXmlTypeMappingArray();
for (int j = 0; j < javaXmlTypeMappings.length; j++) {
JavaXmlTypeMappingType javaXmlTypeMapping = javaXmlTypeMappings[j];
SchemaTypeKey key;
boolean isElement = javaXmlTypeMapping.getQnameScope().getStringValue().equals("element");
boolean isSimpleType = javaXmlTypeMapping.getQnameScope().getStringValue().equals("simpleType");
if (javaXmlTypeMapping.isSetRootTypeQname()) {
QName typeQName = javaXmlTypeMapping.getRootTypeQname().getQNameValue();
key = new SchemaTypeKey(typeQName, isElement, isSimpleType, false, null);
// Skip the wrapper elements.
if (wrapperElementQNames.contains(typeQName)) {
continue;
}
} else if (javaXmlTypeMapping.isSetAnonymousTypeQname()) {
String anonTypeQNameString = javaXmlTypeMapping.getAnonymousTypeQname().getStringValue();
int pos = anonTypeQNameString.lastIndexOf(":");
if (pos == -1) {
throw new DeploymentException("anon QName is invalid, no final ':' " + anonTypeQNameString);
}
//this appears to be ignored...
QName typeQName = new QName(anonTypeQNameString.substring(0, pos), anonTypeQNameString.substring(pos + 1));
key = new SchemaTypeKey(typeQName, isElement, isSimpleType, true, null);
// Skip the wrapper elements.
if (wrapperElementQNames.contains(new QName(anonTypeQNameString.substring(0, pos), anonTypeQNameString.substring(pos + 2)))) {
continue;
}
} else {
throw new DeploymentException("either root type qname or anonymous type qname must be set");
}
SchemaType schemaType = (SchemaType) schemaTypeKeyToSchemaTypeMap.get(key);
if (schemaType == null) {
// if it is a built-in type, then one assumes a redundant mapping.
if (null != TypeMappingLookup.getFactoryPair(key.getqName())) {
continue;
}
// throw new DeploymentException("Schema type key " + key + " not found in analyzed schema: " + schemaTypeKeyToSchemaTypeMap);
log.warn("Schema type key " + key + " not found in analyzed schema: " + schemaTypeKeyToSchemaTypeMap);
continue;
}
mappedTypeQNames.add(key.getqName());
String className = javaXmlTypeMapping.getJavaType().getStringValue().trim();
Class clazz = null;
try {
clazz = ClassLoading.loadClass(className, cl);
} catch (ClassNotFoundException e2) {
throw new DeploymentException("Could not load java type", e2);