public static void main(String[] args)
{
Schema2XMI schema2Xmi = new Schema2XMI();
try
{
CommandLine commandLine = schema2Xmi.parseCommands(args);
if (
commandLine.hasOption(HELP) ||
!(
commandLine.hasOption(OUTPUT_MODEL) && commandLine.hasOption(DRIVER) &&
commandLine.hasOption(CONNECTION_URL) && commandLine.hasOption(USER) &&
commandLine.hasOption(PASSWORD)
))
{
Schema2XMI.displayHelp();
}
else
{
String inputModel = commandLine.getOptionValue(INPUT_MODEL);
SchemaTransformer transformer =
new SchemaTransformer(
commandLine.getOptionValue(DRIVER),
commandLine.getOptionValue(CONNECTION_URL),
commandLine.getOptionValue(USER),
commandLine.getOptionValue(PASSWORD));
// set the extra options
transformer.setXmiVersion(commandLine.getOptionValue(XMI_VERSION));
transformer.setTypeMappings(commandLine.getOptionValue(MAPPINGS));
transformer.setPackageName(commandLine.getOptionValue(PACKAGE));
transformer.setSchema(commandLine.getOptionValue(SCHEMA));
transformer.setTableNamePattern(commandLine.getOptionValue(TABLE_PATTERN));
transformer.setColumnNamePattern(commandLine.getOptionValue(COLUMN_PATTERN));
transformer.setClassStereotypes(commandLine.getOptionValue(CLASS_STEREOTYPES));
transformer.setIdentifierStereotypes(commandLine.getOptionValue(IDENTIFIER_STEREOTYPES));
transformer.setTableTaggedValue(commandLine.getOptionValue(TABLE_TAGGEDVALUE));
transformer.setColumnTaggedValue(commandLine.getOptionValue(COLUMN_TAGGEDVALUE));
String outputLocation = commandLine.getOptionValue(OUTPUT_MODEL);
transformer.transform(inputModel, outputLocation);
}
}
catch (Throwable throwable)
{