JavaXmlTypeMapping jxtm = null;
if (xt instanceof XSComplexTypeDefinition)
{
XSModelGroup xm = null;
XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xt;
XSTypeDefinition baseType = xc.getBaseType();
short der = xc.getDerivationMethod();
String typeQName = "";
if ((baseType != null) && !utils.isBaseTypeIgnorable(baseType, xc))
{
addJavaXMLTypeMap(baseType, baseType.getName(), "", "", jwm, skipWrapperArray); //Recurse for base types
}
// handleContentTypeElementsWithDerivationNone
if (xc.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
{
XSParticle xp = xc.getParticle();
if (xp != null)
{
XSTerm xterm = xp.getTerm();
if (xterm instanceof XSModelGroup)
xm = (XSModelGroup)xterm;
}
}
if ((skipWrapperArray && SchemaUtils.isWrapperArrayType(xt)) == false)
{
jxtm = new JavaXmlTypeMapping(jwm);
String javaType;
String localName = xt.getName();
// Anonymous
if (localName == null)
{
String tempName = containingElement + ToolsUtils.firstLetterUpperCase(name);
javaType = getJavaTypeAsString(null, new QName(tempName), xt.getNamespace(), false, true);
StringBuilder temp = new StringBuilder();
if (containingType != null && containingType.length() > 0)
temp.append(containingType);
temp.append(">").append(name);
localName = temp.toString();
jxtm.setAnonymousTypeQName(new QName(xt.getNamespace(), localName, "typeNS"));
typeQName = localName;
}
else
{
javaType = getJavaTypeAsString(null, new QName(localName), xt.getNamespace(), false, true);
jxtm.setRootTypeQName(new QName(xt.getNamespace(), xt.getName(), "typeNS"));
typeQName = xc.getName();
}
if (typeNamespace == null)
{
typeNamespace = xt.getNamespace();
}
if (registeredTypes.contains(javaType))
return;
jxtm.setJavaType(javaType);
jxtm.setQNameScope("complexType");
registeredTypes.add(javaType);
jwm.addJavaXmlTypeMappings(jxtm);
// addJavaXMLTypeMapping(jwm, jxtm
if (xm != null)
{
addVariableMappingMap(xm, jxtm, javaType);
}
// Add simple content if it exists
XSSimpleTypeDefinition simple = xc.getSimpleType();
if (simple != null)
{
addJavaXMLTypeMap(simple, xc.getName(), "", "", jwm, skipWrapperArray);
}
// Add attributes
XSObjectList attributeUses = ((XSComplexTypeDefinition)xc).getAttributeUses();
if (attributeUses != null)