Package ca.phon.app.modules
Class EntryPointArgParser
java.lang.Object
org.apache.commons.cli.Parser
org.apache.commons.cli.GnuParser
ca.phon.app.modules.EntryPointArgParser
- All Implemented Interfaces:
org.apache.commons.cli.CommandLineParser
public class EntryPointArgParser
extends org.apache.commons.cli.GnuParser
Custom parser for entry point arguments.
-
Field Summary
Fields inherited from class org.apache.commons.cli.Parser
cmd
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
** COPIED FROM APACHE CLI CODE for GnuParser ** ** Modified to split non-options with '=' into separate tokens ** This flatten method does so using the following rules: If anOption
exists for the first character of thearguments
entry AND anOption
does not exist for the wholeargument
then add the first character as an option to the processed tokens list e.g.protected void
processOption
(String arg, ListIterator iter) Methods inherited from class org.apache.commons.cli.Parser
checkRequiredOptions, getOptions, getRequiredOptions, parse, parse, parse, parse, processArgs, processProperties, setOptions
-
Constructor Details
-
EntryPointArgParser
public EntryPointArgParser()
-
-
Method Details
-
flatten
protected String[] flatten(org.apache.commons.cli.Options options, String[] arguments, boolean stopAtNonOption) ** COPIED FROM APACHE CLI CODE for GnuParser ** ** Modified to split non-options with '=' into separate tokens ** This flatten method does so using the following rules:- If an
Option
exists for the first character of thearguments
entry AND anOption
does not exist for the wholeargument
then add the first character as an option to the processed tokens list e.g. "-D" and add the rest of the entry to the also. - Otherwise just add the token to the processed tokens list.
- Overrides:
flatten
in classorg.apache.commons.cli.GnuParser
- Parameters:
options
- The Options to parse the arguments by.arguments
- The arguments that have to be flattened.stopAtNonOption
- specifies whether to stop flattening when a non option has been encountered- Returns:
- a String array of the flattened arguments
- If an
-
processOption
protected void processOption(String arg, ListIterator iter) throws org.apache.commons.cli.ParseException - Overrides:
processOption
in classorg.apache.commons.cli.Parser
- Throws:
org.apache.commons.cli.ParseException
-