if (repackage!=null)
{
SchemaTypeLoaderImpl.METADATA_PACKAGE_LOAD = SchemaTypeSystemImpl.METADATA_PACKAGE_GEN;
String stsPackage = SchemaTypeSystem.class.getPackage().getName();
Repackager repackager = new Repackager( repackage );
SchemaTypeSystemImpl.METADATA_PACKAGE_GEN = repackager.repackage(new StringBuffer(stsPackage)).toString().replace('.','_');
System.out.println("\n\n\n" + stsPackage + ".SchemaCompiler Metadata LOAD:" + SchemaTypeLoaderImpl.METADATA_PACKAGE_LOAD + " GEN:" + SchemaTypeSystemImpl.METADATA_PACKAGE_GEN);
}
SchemaCodePrinter codePrinter = params.getSchemaCodePrinter();
List extensions = params.getExtensions();
Set mdefNamespaces = params.getMdefNamespaces();
EntityResolver cmdLineEntRes = params.getEntityResolver() == null ?
ResolverUtil.resolverForCatalog(params.getCatalogFile()) : params.getEntityResolver();
if (srcDir == null || classesDir == null)
throw new IllegalArgumentException("src and class gen directories may not be null.");
long start = System.currentTimeMillis();
// Calculate the usenames based on the relativized filenames on the filesystem
if (baseDir == null)
baseDir = new File(SystemProperties.getProperty("user.dir"));
ResourceLoader cpResourceLoader = null;
Map sourcesToCopyMap = new HashMap();
if (classpath != null)
cpResourceLoader = new PathResourceLoader(classpath);
boolean result = true;
File schemasDir = IOUtil.createDir(classesDir, "schema" + SchemaTypeSystemImpl.METADATA_PACKAGE_GEN + "/src");
// build the in-memory type system
XmlErrorWatcher errorListener = new XmlErrorWatcher(outerErrorListener);
SchemaTypeSystem system = loadTypeSystem(name, xsdFiles, wsdlFiles, urlFiles, configFiles,
javaFiles, cpResourceLoader, download, noUpa, noPvr, noAnn, noVDoc, noExt, mdefNamespaces,
baseDir, sourcesToCopyMap, errorListener, schemasDir, cmdLineEntRes, classpath, javasource);
if (errorListener.hasError())
result = false;
long finish = System.currentTimeMillis();
if (!quiet)
System.out.println("Time to build schema type system: " + ((double)(finish - start) / 1000.0) + " seconds" );
// now code generate and compile the JAR
if (result && system != null) // todo: don't check "result" here if we want to compile anyway, ignoring invalid schemas
{
start = System.currentTimeMillis();
// filer implementation writes binary .xsd and generated source to disk
Repackager repackager = (repackage == null ? null : new Repackager(repackage));
FilerImpl filer = new FilerImpl(classesDir, srcDir, repackager, verbose, incrSrcGen);
// currently just for schemaCodePrinter
XmlOptions options = new XmlOptions();
if (codePrinter != null)