if (xsparticle != null)
{
XSTerm xsterm = xsparticle.getTerm();
if (xsterm instanceof XSModelGroup)
{
XSModelGroup xsm = (XSModelGroup)xsterm;
XSObjectList xparts = xsm.getParticles();
int len = xparts != null ? xparts.getLength() : 0;
int diff = len - 0;
for (int i = 0; i < len; i++)
{
if (isExceptionType && type.getBaseType() != null)
{
List<VAR> baseList = new ArrayList<VAR>();
//The first few xsterms are modelgroups for base class
for (int j = 0; j < diff - 1; j++)
{
XSParticle xspar = (XSParticle)xparts.item(j);
XSTerm xsparTerm = xspar.getTerm();
if (xsparTerm instanceof XSModelGroup)
{
XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
baseList.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
}
}
if (baseList.size() > 0)
this.typeNameToBaseVARList.put(type.getName(), baseList);
//Now take the modelgroup for the type in question
XSParticle xspar = (XSParticle)xparts.item(len - 1);
XSTerm xsparTerm = xspar.getTerm();
if (xsparTerm instanceof XSModelGroup)
{
XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
}
break;
}
XSParticle xspar = (XSParticle)xparts.item(i);
XSTerm xsparTerm = xspar.getTerm();
if (xsparTerm instanceof XSModelGroup)
{
XSModelGroup xsmodelgrp = (XSModelGroup)xspar.getTerm();
vars.addAll(createVARsforXSModelGroup(xsmodelgrp, schema, type));
}
else if (xsparTerm instanceof XSElementDeclaration)
vars.addAll(createVARforXSElementDeclaration(xsparTerm, schemautils.isArrayType(xspar), schema, type));
}