private XmlSchemaComplexType getComplexBaseType( XmlSchemaComplexContentExtension schemaComplexContent, XmlSchema schema) { XmlSchemaComplexType complexBaseType = null; QName baseTypeName = schemaComplexContent.getBaseTypeName(); XmlSchemaType baseType = schema.getTypeByName(baseTypeName); if (baseType != null) { if (baseType instanceof XmlSchemaComplexType) { complexBaseType = (XmlSchemaComplexType) baseType; } else { throw new RuntimeException( "Unsupported complex base type: " + baseType.getClass().getCanonicalName()); } } else { throw new RuntimeException("Schema complex base type not found: " + baseTypeName); } return complexBaseType; }
private XmlSchemaSimpleType getSimpleBaseType(QName simpleBaseTypeName, XmlSchema schema) { XmlSchemaSimpleType simpleBaseType = null; if (simpleBaseTypeName != null) { XmlSchemaType baseType = schema.getTypeByName(simpleBaseTypeName); if (baseType != null) { if (baseType instanceof XmlSchemaSimpleType) { simpleBaseType = (XmlSchemaSimpleType) baseType; } else { throw new RuntimeException( "Unsupported simple base type: " + baseType.getClass().getCanonicalName()); } } else { throw new RuntimeException("Schema simple base type not found: " + simpleBaseTypeName); } } return simpleBaseType; }