if(args.length == 0) {
return;
}
AbstractSessionLog.getLog().setLevel(AbstractSessionLog.FINER);
SDOClassGenerator generator = new SDOClassGenerator(new SDOHelperContext());
generator.setImplGenerator(false);
String sourceDir = null;
String sourceFile = null;
int argsLength = args.length;
for(int i=0; i<argsLength; i++) {
if("-b".equals(args[i])) {
argsLength = i;
break;
}
}
for(int i=0; i<argsLength; i++) {
if(args[i].equals("-d")) {
sourceDir = args[++i];
} else if(i == argsLength - 1) {
sourceFile = args[i];
}
}
try {
FileReader reader = new FileReader(sourceFile);
FileCodeWriter fileCodeWriter = new FileCodeWriter();
fileCodeWriter.setSourceDir(sourceDir);
generator.generate(reader, fileCodeWriter, new DefaultSchemaResolver());
} catch (IOException e) {
AbstractSessionLog.getLog().log(AbstractSessionLog.SEVERE, "sdo_classgenerator_exception",//
e.getClass().getName(), e.getLocalizedMessage(), generator.getClass());
AbstractSessionLog.getLog().logThrowable(AbstractSessionLog.SEVERE, e);
}
}