} else
throw new BuildException("Invalid line-separator style.");
} else
lineSep = "\n"; // default
SourceGenerator sgen = null;
if (typeFactory != null) {
try {
sgen = new SourceGenerator((FieldInfoFactory)Class.forName(typeFactory).newInstance());
} catch(Exception ex) {
project.log("Type factory "+typeFactory+" is invalid.",project.MSG_INFO);
throw new BuildException(ex);
}
} else {
sgen = new SourceGenerator(); // default
}
sgen.setLineSeparator(lineSep);
sgen.setSuppressNonFatalWarnings(force);
sgen.setDestDir(destDir.toString());
if (force)
project.log("Suppressing non fatal warnings.",project.MSG_VERBOSE);
try {
sgen.generateSource(schema.getAbsolutePath(), pkgName);
} catch(IOException ex) {
project.log("Failed to compile " + schema,project.MSG_INFO);
throw new BuildException(ex);
}
} //-- execute