DBVIEW
org.dbview.runtime.cli.CliParser Class Reference

List of all members.

Static Public Member Functions

static String help ()
static CliData parse (String[] in_vargs)

Static Public Attributes

static final String CLI_INPUT_ADDON = "db-adaptor"
static final String CLI_OUTPUT_ADDON = "exporter"
static final String CLI_PROFILE = "profile"
static final String CLI_BETWEEN = "between"
static final String CLI_ZOOM = "zoom"
static final String CLI_ZOOM_LEVEL = "zoom-level"
static final String CLI_LIMIT = "limit"
static final String CS_HELP = "help"
static final String CS_LIST_INPUT = "list-db-adaptors"
static final String CS_LIST_OUTPUT_TABLE = "list-table-exporters"
static final String CS_INPUT_ADDON_HELP = "help-db-adaptor"
static final String CS_OUTPUT_ADDON_HELP = "help-table-exporter"
static final String CS_PROFILE_ADD = "profile-add"
static final String CS_PROFILE_DELETE = "profile-delete"
static final String CS_PROFILE_SHOW = "profile-show"
static final String CS_PROFILE_UPDATE = "profile-update"
static final String CS_PROFILE_LIST = "profile-list"
static final String CS_EXPORT = "export"
static final String CS_LIST_SFK_DETECTOR = "list-soft-key-detectors"

Static Private Member Functions

static void __init () throws Exception
static CliData __tryHelp () throws Exception
static CliData __tryInputHelp () throws Exception
static CliData __tryOutputHelp () throws Exception
static CliData __tryTargetInput ()
static CliData __tryListFkMatcher ()
static CliData __tryAddOnOutputTable ()
static CliData __tryProfileAdd ()
static CliData __tryProfileDelete ()
static CliData __tryProfileShow ()
static CliData __tryProfileUpdate ()
static CliData __tryProfileList ()
static CliData __tryExport ()
static String __checkCliEmpty ()
static ArrayList< String > __shrinkArgv (ArrayList< OptionContainer > in_options)
static void __debug (String in_argv[])

Static Private Attributes

static String[] __vargs = null
static InputCatalog __catalog = null

Detailed Description

This class handles the process of parsing the command line, which is not a trivial action.

Author:
Denis BEURIVE

Definition at line 47 of file CliParser.java.


Member Function Documentation

static String org.dbview.runtime.cli.CliParser.__checkCliEmpty ( ) [static, private]

This method makes sure that the command line does not contain any command line parameter after the command selector.

Returns:
  • If the command line does not contain any command line parameter after the command selector, then the method returns the value null.
  • Otherwise, the method returns a string that represents the error message.
Exceptions:
Exception

Definition at line 1075 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryAddOnOutputTable(), org.dbview.runtime.cli.CliParser.__tryHelp(), org.dbview.runtime.cli.CliParser.__tryListFkMatcher(), and org.dbview.runtime.cli.CliParser.__tryTargetInput().

static void org.dbview.runtime.cli.CliParser.__debug ( String  in_argv[]) [static, private]

Print the command line.

Parameters:
in_argvThe command line.
Remarks:
This method is used for debug only.

Definition at line 1134 of file CliParser.java.

static void org.dbview.runtime.cli.CliParser.__init ( ) throws Exception [static, private]
static ArrayList<String> org.dbview.runtime.cli.CliParser.__shrinkArgv ( ArrayList< OptionContainer in_options) [static, private]

This method extracts the following argument from the command line:

  • The command selector.
  • The non option argument that may follow the command selector (until the first option is reached)
  • The option's arguments given by the list of given options' containers.
Parameters:
in_optionsThe list of options' containers.
Returns:
The method returns an array of command line arguments.

Definition at line 1099 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), org.dbview.runtime.cli.CliParser.__tryProfileAdd(), and org.dbview.runtime.cli.CliParser.__tryProfileUpdate().

static CliData org.dbview.runtime.cli.CliParser.__tryAddOnOutputTable ( ) [static, private]

Test if the user asks for the list of available output add-ons for tables.

Returns:
  • If the user asks for the list of available output add-ons, then the method returns an instance of CliData. The value of the member "type" of the returned object is CliConstantes.CLI_LIST_OUTPUT_TARGETS.
  • Otherwise, the method returns the value null.

Definition at line 398 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryExport ( ) [static, private]

This method tests if the user wants to process a given database.

Returns:
  • If the user wants to process a given database, then the method returns an instance of CliData.
    • The value of the member "type" of the returned object is CliConstantes.CLI_EXPORT.
  • Otherwise, the method returns thevalue null

This class contains the required configuration used to parse the options that represents the list of tables to zoom in.

Author:
Denis BEURIVE

List of tables to zoom at.

Zoom lebel.

This method returns the list of tables to zoom in.

Returns:
The method returns the list of tables to zoom in.

This method returns the zoom level to apply (to a list of tables).

Returns:
The method returns the zoom level to apply (to a list of tables).

This class represents the required configuration used to parse the options that defined a path.

Author:
Denis Beurive

This option represents the two extremities of the path.

This option represents the maximum number of path to calculate.

Return the two extremities of the path to calculate.

Returns:
Return the two extremities of the path to calculate.

Return the maximum number of paths to calculate.

Returns:
Return the maximum number of paths to calculate.

Definition at line 735 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryHelp ( ) throws Exception [static, private]

Test if the user asks for help.

Returns:
  • If the user asks for help, then the method returns an instance of CliData. The value of the member "type" of the returned object is CliConstantes.CLI_HELP.
  • Otherwise, the method returns the value null.

Definition at line 289 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryInputHelp ( ) throws Exception [static, private]

Test if the user wants to print the help for a specific input add-on.

Returns:
  • If the user asks for help, then the method returns an instance of CliData. The value of the member "type" of the returned object is CliConstantes.CLI_INPUT_HELP.
  • Otherwise, the method returns the value null.
Exceptions:
Exception

Definition at line 311 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryListFkMatcher ( ) [static, private]

Test if the user asks for the list of available soft foreign key matchers.

Returns:
  • If the user asks for the list of available soft foreign key matchers, then the method returns an instance of CliData. The value of the member "type" of the returned object is CliConstantes.CLI_LIST_FK_MATCHER.
  • Otherwise, the method returns the value null.

Definition at line 380 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryOutputHelp ( ) throws Exception [static, private]

Test if the user wants to print the help for a specific output add-on.

Returns:
  • If the user asks for help, then the method returns an instance of CliData. The value of the member "type" of the returned object is CliConstantes.CLI_OUTPUT_HELP.
  • Otherwise, the method returns the value null.
Exceptions:
Exception

Definition at line 337 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryProfileAdd ( ) [static, private]

Test if the user wants to add a new profile to the profiles' repository.

Returns:
  • If the user wants to add a new profile, then the method returns an instance of CliData.
    • The value of the member "type" of the returned object is CliConstantes.CLI_PROFILE_ADD.
    • The member "data" of the returned object contains the following keys:
      • "name": The name of the profile to add.
      • "input-target": The add-on's name.
      • "input-target-configuration": the profile's configuration (XML element).
  • Otherwise, the method returns the value null.

This class contains the CLI options needed to add a new profile into the profiles' repository.

Author:
Denis Beurive

Definition at line 426 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryProfileDelete ( ) [static, private]

Test if the user wants to delete a profile.

Returns:
  • If the user wants to delete a profile, then the method returns an instance of CliData.
    • The value of the member "type" of the returned object is CliConstantes.CLI_PROFILE_REMOVE.
    • The member "data" of the returned object contains the following keys:
      • "name": The name of the profile to add.
  • Otherwise, the method returns the value null.

Definition at line 552 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryProfileList ( ) [static, private]

This method tests if the user wants to list all the profiles stored in the repository.

Returns:
  • If the user wants to list all the profiles, then the method returns an instance of CliData.
    • The value of the member "type" of the returned object is CliConstantes.CLI_PROFILE_LIST.
  • Otherwise, the method returns the value null.

Definition at line 716 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryProfileShow ( ) [static, private]

Test if the user wants to print a profile.

Returns:
  • If the user wants to print a profile, then the method returns an instance of CliData.
    • The value of the member "type" of the returned object is CliConstantes.CLI_PROFILE_SHOW.
    • The member "data" of the returned object contains the following keys:
      • "name": The name of the profile to add.
  • Otherwise, the method returns the value null.

Definition at line 586 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryProfileUpdate ( ) [static, private]

Test if the user wants to update a given profile.

Returns:
  • If the user wants to update a profile, then the method returns an instance of CliData.
    • The value of the member "type" of the returned object is CliConstantes.CLI_PROFILE_UPDATE.
    • The member "data" of the returned object contains the following keys:
      • "name": The name of the profile to add.
      • "target"; The add-on's name.
      • "new_configuration": the new profile's configuration (XML element).
      • "old_configuration": the old profile's configuration (XML element).
  • Otherwise, the method returns the value null.

Definition at line 623 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.__tryTargetInput ( ) [static, private]

Test if the user asks for the list of available input add-ons.

Returns:
  • If the user asks for the list of available input add-ons, then the method returns an instance of CliData. The value of the member "type" of the returned object is CliConstantes.CLI_LIST_INPUT_TARGETS.
  • Otherwise, the method returns the value null.

Definition at line 363 of file CliParser.java.

static String org.dbview.runtime.cli.CliParser.help ( ) [static]

This method prints the software' usage.

Returns:
This method returns a string that represents the help message.

Definition at line 191 of file CliParser.java.

static CliData org.dbview.runtime.cli.CliParser.parse ( String[]  in_vargs) [static]

Parse the command line. Please not that this method will try all the specialized command line parsers.

Note:
Specialized parsers are private methods that start with the string of characters "__try", followed by an uppercase letter. Specialized command line parsers take no argument, at return an instance of CliData.
Parameters:
in_vargsArray of strings that represent the command line.
Returns:
The parser returns an instance of CliData.
Exceptions:
Exception

Definition at line 243 of file CliParser.java.


Member Data Documentation

InputCatalog org.dbview.runtime.cli.CliParser.__catalog = null [static, private]

This is the catalogue of all available input add-ons. This object is used to instantiate input add-ons.

Definition at line 58 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__init(), org.dbview.runtime.cli.CliParser.__tryExport(), org.dbview.runtime.cli.CliParser.__tryProfileAdd(), and org.dbview.runtime.cli.CliParser.__tryProfileUpdate().

final String org.dbview.runtime.cli.CliParser.CLI_BETWEEN = "between" [static]

This is a command line option. It represents the two extremities of a path.

Definition at line 83 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CLI_INPUT_ADDON = "db-adaptor" [static]

This is a command line option. It represents an input add-on (used to load a specific database).

Definition at line 64 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), org.dbview.runtime.cli.CliParser.__tryProfileAdd(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CLI_LIMIT = "limit" [static]

This is a command line option. This option is used when the user wants to calculate the path(s) between two tables. it represents the maximum number of paths to show.

Definition at line 102 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CLI_OUTPUT_ADDON = "exporter" [static]

This is a command line option. It represents an output add-on. The output add-on defines the output's format.

Definition at line 71 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CLI_PROFILE = "profile" [static]

This is a command line option. It represents the name of a profile.

Definition at line 77 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CLI_ZOOM = "zoom" [static]

This is a command line option. It represents a list of tables to zoom in.

Definition at line 89 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CLI_ZOOM_LEVEL = "zoom-level" [static]

This is a command line option. If a list of tables to zoom in is defined, then this value represents a zoom level.

Definition at line 95 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_EXPORT = "export" [static]

This is a command selector. The user wants to export a database.

Definition at line 168 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryExport(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_HELP = "help" [static]

This is a command selector. The user requests the print of the general help message.

Definition at line 108 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryHelp(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_INPUT_ADDON_HELP = "help-db-adaptor" [static]

This is a command selector. The user requests the print of the help message for a specific input add-on.

Definition at line 126 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryInputHelp(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_LIST_INPUT = "list-db-adaptors" [static]

This is a command selector. The user requests the list of all available input add-ons.

Definition at line 114 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryTargetInput(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_LIST_OUTPUT_TABLE = "list-table-exporters" [static]

This is a command selector. VThe user requests the list of all available output add-ons for tables.

Definition at line 120 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryAddOnOutputTable(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_LIST_SFK_DETECTOR = "list-soft-key-detectors" [static]

This is a command selector. The user wants to print the list of all available soft foreign key detectors.

Definition at line 174 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryListFkMatcher(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_OUTPUT_ADDON_HELP = "help-table-exporter" [static]

This is a command selector. The user requests the print of the help message for a specific output add-on.

Definition at line 132 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryOutputHelp(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_PROFILE_ADD = "profile-add" [static]

This is a command selector. The user wants to add a new profile to the profiles' repository.

Definition at line 138 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryProfileAdd(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_PROFILE_DELETE = "profile-delete" [static]

This is a command selector. The user wants to remove a profile from the profiles' repository.

Definition at line 144 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryProfileDelete(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_PROFILE_LIST = "profile-list" [static]

This is a command selector. The user wants to print all profiles in the profiles' repository.

Definition at line 162 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryProfileList(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_PROFILE_SHOW = "profile-show" [static]

This is a command selector. The user wants to print a given profile.

Definition at line 150 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryProfileShow(), and org.dbview.runtime.cli.CliParser.help().

final String org.dbview.runtime.cli.CliParser.CS_PROFILE_UPDATE = "profile-update" [static]

This is a command selector. The user wants to update a given profile.

Definition at line 156 of file CliParser.java.

Referenced by org.dbview.runtime.cli.CliParser.__tryProfileUpdate(), and org.dbview.runtime.cli.CliParser.help().


The documentation for this class was generated from the following file: