ComplexType gtType = new AbstractLazyComplexTypeImpl(name(xsdType), false,
xsdType.isAbstract(), null, null) {
@Override
public AttributeType buildSuper() {
XSDTypeDefinition baseType = xsdType.getBaseType();
if (baseType != null && baseType.getName() != null && !baseType.equals(xsdType)) {
return createType(baseType, DUMMY_DEPTH);
} else {
return null;
}
}
@SuppressWarnings("unchecked")
@Override
public Collection<PropertyDescriptor> buildDescriptors() {
if (!followComplexTypes) {
// might need to generate shallow schema classes while bootstrapping
return null;
} else {
List<PropertyDescriptor> properties = new ArrayList<PropertyDescriptor>();
for (XSDParticle particle : (List<XSDParticle>) Schemas
.getChildElementParticles(xsdType, false)) {
XSDElementDeclaration element = (XSDElementDeclaration) particle
.getContent();
if (element.isElementDeclarationReference()) {
element = element.getResolvedElementDeclaration();
}
XSDTypeDefinition childType = element.getTypeDefinition();
if (childType == null) {
childType = findGlobalElementXSDType(element);
}
AttributeType gtType = null;
if (childType != null) {