*
* @return a new CommandLineOptions object fully configured to parse our
* command line.
*/
private static CommandLineOptions setupCommandLineOptions() {
CommandLineOptions allOptions = new CommandLineOptions();
String desc;
//-- filename flag
desc = "Sets the filename for the schema used as input.";
allOptions.addFlag(ARGUMENT_INPUT, "schema filename", desc);
//-- filename flag
desc = "Sets the input source for the schema used as input.";
allOptions.addFlag(ARGUMENT_INPUT_SOURCE, "input source for XML schema", desc);
//-- package name flag
desc = "Sets the package name for generated code.";
allOptions.addFlag(ARGUMENT_PACKAGE, "package name", desc, true);
//-- destination directory
desc = "Sets the destination output directory.";
allOptions.addFlag(ARGUMENT_DESTINATION_DIR, "destination directory", desc, true);
//-- line break flag
desc = "Sets the line separator style for the desired platform.";
allOptions.addFlag(ARGUMENT_LINE_SEPARATOR, "(unix | mac | win)", desc, true);
//-- Force flag
desc = "Suppresses non fatal warnings, such as overwriting files.";
allOptions.addFlag(ARGUMENT_FORCE, "", desc, true);
//-- Help flag
desc = "Displays this help screen.";
allOptions.addFlag(ARGUMENT_HELP, "", desc, true);
//-- verbose flag
desc = "Prints out additional messages when creating source.";
allOptions.addFlag(ARGUMENT_VERBOSE, "", desc, true);
//-- fail on first error flag
desc = "Causes source generation to fail on the first error encountered.";
allOptions.addFlag(ARGUMENT_FAIL_ON_ERROR, "", desc, true);
//-- no descriptors flag
desc = "Disables the generation of the Class descriptors.";
allOptions.addFlag(ARGUMENT_DISABLE_DESCRIPTORS, "", desc, true);
//-- mapping file flag
desc = "Indicates that a mapping file should be generated.";
allOptions.addFlag(ARGUMENT_GENERATE_MAPPING, "mapping filename", desc, true);
//-- source generator types name flag
desc = "Sets the source generator types name (SGTypeFactory).";
allOptions.addFlag(ARGUMENT_TYPES, "types", desc, true);
//-- We temporarily maintain backwards compatibility, but this argument is deprecated
desc = "";
allOptions.addFlag(ARGUMENT_TYPES_DEPRECATED, "collections class name", desc, true);
//-- no marshaling framework methods
desc = "Disables the generation of the methods specific to the XML marshaling framework.";
allOptions.addFlag(ARGUMENT_NOMARSHALL, "", desc, true);
//-- implements org.castor.xmlctf.CastorTestable?
desc = "Implements some specific methods to allow the generated classes"
+ " to be used with Castor Testing Framework.";
allOptions.addFlag(ARGUMENT_TESTABLE, "", desc, true);
//-- use SAX1?
desc = "Uses SAX 1 in the generated code.";
allOptions.addFlag(ARGUMENT_SAX1, "", desc, true);
//-- Source Generator Binding
desc = "Sets the Source Generator Binding File name.";
allOptions.addFlag(ARGUMENT_BINDING_FILENAME, "filename", desc, true);
//-- Generates sources for imported XML Schemas
desc = "Generates sources for imported XML schemas.";
allOptions.addFlag(ARGUMENT_GENERATE_IMPORTED_SCHEMAS, "", desc, true);
//-- Sets enumerated type to use a case insensitive lookup
desc = "Sets enumerated types to use a case insensitive lookup.";
allOptions.addFlag(ARGUMENT_CASE_INSENSITIVE, "", desc);
//-- Sets enumerated type to use a case insensitive lookup
desc = "Sets name conflict strategy to use (possible values are "
+ "'informViaLog', 'warnViaConsoleDialog').";
allOptions.addFlag(ARGUMENT_NAME_CONFLICT_STRATEGY, "", desc);
return allOptions;
}