Enumeration enumeration = schema.getImportedSchema(); while (enumeration.hasMoreElements()) { Schema importedSchema = (Schema) enumeration.nextElement(); if (!_generateImported) { System.out.println(); System.out.println(IMPORT_WARNING + importedSchema.getSchemaLocation()); } else { _schemasProcessed.add(schema); if (!_schemasProcessed.contains(importedSchema)) { SGStateInfo importedSInfo  = new SGStateInfo(importedSchema, this); importedSInfo._packageName = sInfo._packageName; generateAllClassFiles(importedSchema, importedSInfo);   sInfo.storeImportedSourcesByName(importedSInfo.getSourcesByName()); sInfo.storeImportedSourcesByName(importedSInfo.getImportedSourcesByName());  importedSInfo = null; } } }
processImportedSchemas(schema, sInfo);
    private void generateAllClassFiles(final Schema schema, final SGStateInfo sInfo) throws IOException {        //-- ** print warnings for imported schemas **        if (!_suppressNonFatalWarnings || _generateImported) {            Enumeration enumeration = schema.getImportedSchema();            while (enumeration.hasMoreElements()) {                Schema importedSchema = (Schema) enumeration.nextElement();                if (!_generateImported) {                    System.out.println();                    System.out.println(IMPORT_WARNING + importedSchema.getSchemaLocation());                } else {                    _schemasProcessed.add(schema);                    if (!_schemasProcessed.contains(importedSchema)) {                        SGStateInfo importedSInfo  = new SGStateInfo(importedSchema, this);                        importedSInfo._packageName = sInfo._packageName;                        generateAllClassFiles(importedSchema, importedSInfo);                        //--'store' the imported JClass instances                        sInfo.storeImportedSourcesByName(importedSInfo.getSourcesByName());                        sInfo.storeImportedSourcesByName(importedSInfo.getImportedSourcesByName());                        //--discard the SGStateInfo                        importedSInfo = null;                    }                }            }        }        //-- ** Generate code for all TOP-LEVEL structures **        Enumeration structures;        //-- handle all top-level element declarations        for (structures = schema.getElementDecls(); structures.hasMoreElements(); ) {            createClasses((ElementDecl) structures.nextElement(), sInfo);        }        //-- handle all top-level complextypes        for (structures = schema.getComplexTypes(); structures.hasMoreElements(); ) {            processComplexType((ComplexType) structures.nextElement(), sInfo);        }        //-- handle all top-level simpletypes        for (structures = schema.getSimpleTypes(); structures.hasMoreElements(); ) {            processSimpleType((SimpleType) structures.nextElement(), sInfo);        }        //-- handle all top-level groups        for (structures = schema.getModelGroups(); structures.hasMoreElements(); ) {            createClasses((ModelGroup) structures.nextElement(), sInfo);        }        //-- clean up any remaining JClasses which need printing        _singleClassGenerator.processIfNotAlreadyProcessed(sInfo.keys(), sInfo);        //-- handle cdr files        for (Enumeration cdrFiles = sInfo.getCDRFilenames(); cdrFiles.hasMoreElements(); ) {            String filename = (String) cdrFiles.nextElement();            Properties props = sInfo.getCDRFile(filename);            props.store(new FileOutputStream(new File(filename)), null);        }    } //-- createClasses