compiler.setErrorListener(elForRun);
addSchemas(wsdlUrl, schemas, compiler);
S2JJAXBModel intermediateModel = compiler.bind();
JCodeModel codeModel = intermediateModel.generateCode(null, elForRun);
StringBuilder sb = new StringBuilder();
boolean firstnt = false;
for (Iterator<JPackage> packages = codeModel.packages(); packages.hasNext();) {
JPackage packadge = packages.next();
String name = packadge.name();
if ("org.w3._2001.xmlschema".equals(name)) {
continue;
}
if (firstnt) {
sb.append(':');
} else {
firstnt = true;
}
sb.append(packadge.name());
}
outputDebug(codeModel);
String packageList = sb.toString();
// our hashcode + timestamp ought to be enough.
String stem = toString() + "-" + System.currentTimeMillis();
File src = new File(tmpdir, stem + "-src");
if (!src.mkdir()) {
throw new IllegalStateException("Unable to create working directory " + src.getPath());
}
try {
FileCodeWriter writer = new FileCodeWriter(src);
codeModel.build(writer);
} catch (IOException e) {
throw new IllegalStateException("Unable to write generated Java files for schemas: "
+ e.getMessage(), e);
}
File classes = new File(tmpdir, stem + "-classes");