private static JavaQName getParentType(XmlSchemaType type) {
if(type instanceof XmlSchemaSimpleType) {
return JavaQNameImpl.getInstance(Object.class);
} else {
XmlSchemaComplexType complexType = (XmlSchemaComplexType)type;
XmlSchemaContentModel contentModel = complexType.getContentModel();
if(contentModel!=null) {
if(contentModel instanceof XmlSchemaSimpleContent) {
return JavaQNameImpl.getInstance(Object.class);
} else {
XmlSchemaContent content = contentModel.getContent();
if(content instanceof XmlSchemaComplexContentExtension) {
XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)content;
return JavaSourceUtils.toJavaQName(ext.getBaseTypeName());
} else {
XmlSchemaComplexContentRestriction rest = (XmlSchemaComplexContentRestriction)content;