}
}
private JCodeModel createCodeModel(List<SchemaInfo> schemaElements, Set<String> type) {
SchemaCompiler compiler = createCompiler(type);
Object elForRun = ReflectionInvokationHandler
.createProxyWrapper(new InnerErrorListener(),
JAXBUtils.getParamClass(compiler, "setErrorListener"));
compiler.setErrorListener(elForRun);
compiler.setEntityResolver(OASISCatalogManager.getCatalogManager(bus)
.getEntityResolver());
if (compilerArgs.size() > 0) {
compiler.getOptions().addGrammar(new InputSource("null"));
compiler.getOptions().parseArguments(compilerArgs.toArray(new String[] {}));
}
addSchemas(schemaElements, compiler);
for (InputSource is : bindingFiles) {
compiler.getOptions().addBindFile(is);
}
S2JJAXBModel intermediateModel = compiler.bind();
JCodeModel codeModel = intermediateModel.generateCode(null, elForRun);
JAXBUtils.logGeneratedClassNames(LOG, codeModel);
return codeModel;
}