com.openexchange.admin.console
Class AdminParser

java.lang.Object
  extended by com.openexchange.admin.console.CLIParser
      extended by com.openexchange.admin.console.AdminParser

public class AdminParser
extends CLIParser

This class is used to extend the CmdLineParser which two main things: 1. The ability to output help texts 2. The ability to have mandatory options


Nested Class Summary
static class AdminParser.NeededQuadState
           
 
Constructor Summary
AdminParser(String appname)
           
 
Method Summary
 CLIOption addIntegerOption(String longForm, String longFormParameterDescription, String description, boolean needed, boolean hasarg, boolean extended)
           
 CLIOption addOption(char shortForm, String longForm, String description, boolean needed)
          This method is used to add an option with a mandatory field
 CLIOption addOption(char shortForm, String longForm, String longFormParameterDescription, String description, AdminParser.NeededQuadState needed, boolean hasarg)
           
 CLIOption addOption(char shortForm, String longForm, String longFormParameterDescription, String description, boolean needed)
          This method is used if you want to add an option with a description for the long parameter
 CLIOption addOption(String longForm, String longFormParameterDescription, String description, boolean needed)
           
 CLIOption addOption(String longForm, String longFormParameterDescription, String description, boolean needed, boolean hasarg)
           
 CLIOption addOption(String longForm, String longFormParameterDescription, String description, boolean needed, boolean hasarg, boolean extended)
           
 CLIOption addSettableBooleanOption(String longForm, String longFormParameterDescription, String description, boolean needed, boolean hasarg, boolean extended)
           
 void allowDynamicOptions()
           
 boolean checkNoNewLine()
           
 void forbidDynamicOptions()
           
 CLIOption getCsvImportOption()
           
 Map<String,Map<String,String>> getDynamicArguments()
           
 void ownparse(String[] args)
           
 void printEnvUsage()
           
 void printUsage()
           
 void printUsageExtended()
           
 void removeOption(String shortForm, String longForm)
           
 void setCsvImportOption(CLIOption csvImportOption)
           
 void setExtendedOptions()
           
 
Methods inherited from class com.openexchange.admin.console.CLIParser
addBooleanOption, addBooleanOption, addDoubleOption, addDoubleOption, addIntegerOption, addIntegerOption, addLongOption, addLongOption, addOption, addSettableBooleanOption, addStringOption, addStringOption, getOptionValue, getOptionValue, getOptionValues, getRemainingArgs, parse, parse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminParser

public AdminParser(String appname)
Method Detail

addOption

public final CLIOption addOption(char shortForm,
                                 String longForm,
                                 String description,
                                 boolean needed)
This method is used to add an option with a mandatory field

Parameters:
shortForm -
longForm -
description -
needed -
Returns:

addOption

public final CLIOption addOption(char shortForm,
                                 String longForm,
                                 String longFormParameterDescription,
                                 String description,
                                 boolean needed)
This method is used if you want to add an option with a description for the long parameter

Parameters:
shortForm -
longForm -
longFormParameterDescription -
description -
Returns:

addOption

public final CLIOption addOption(char shortForm,
                                 String longForm,
                                 String longFormParameterDescription,
                                 String description,
                                 AdminParser.NeededQuadState needed,
                                 boolean hasarg)
Parameters:
shortForm -
longForm -
longFormParameterDescription -
description -
needed -
hasarg -
Returns:

addOption

public final CLIOption addOption(String longForm,
                                 String longFormParameterDescription,
                                 String description,
                                 boolean needed)
Parameters:
longForm -
longFormParameterDescription -
description -
needed -
Returns:

addOption

public final CLIOption addOption(String longForm,
                                 String longFormParameterDescription,
                                 String description,
                                 boolean needed,
                                 boolean hasarg)
Parameters:
longForm -
longFormParameterDescription -
description -
needed -
hasarg -
Returns:

addOption

public final CLIOption addOption(String longForm,
                                 String longFormParameterDescription,
                                 String description,
                                 boolean needed,
                                 boolean hasarg,
                                 boolean extended)
Parameters:
longForm -
longFormParameterDescription -
description -
needed -
hasarg -
extended -
Returns:

addIntegerOption

public final CLIOption addIntegerOption(String longForm,
                                        String longFormParameterDescription,
                                        String description,
                                        boolean needed,
                                        boolean hasarg,
                                        boolean extended)
Parameters:
longForm -
longFormParameterDescription -
description -
needed -
hasarg -
extended -
Returns:

addSettableBooleanOption

public final CLIOption addSettableBooleanOption(String longForm,
                                                String longFormParameterDescription,
                                                String description,
                                                boolean needed,
                                                boolean hasarg,
                                                boolean extended)

checkNoNewLine

public final boolean checkNoNewLine()

getCsvImportOption

public CLIOption getCsvImportOption()

ownparse

public final void ownparse(String[] args)
                    throws CLIParseException,
                           CLIIllegalOptionValueException,
                           CLIUnknownOptionException,
                           MissingOptionException
Throws:
CLIParseException
CLIIllegalOptionValueException
CLIUnknownOptionException
MissingOptionException

setCsvImportOption

public void setCsvImportOption(CLIOption csvImportOption)

setExtendedOptions

public final void setExtendedOptions()

printEnvUsage

public final void printEnvUsage()

printUsage

public final void printUsage()

printUsageExtended

public final void printUsageExtended()

removeOption

public void removeOption(String shortForm,
                         String longForm)

allowDynamicOptions

public void allowDynamicOptions()

forbidDynamicOptions

public void forbidDynamicOptions()

getDynamicArguments

public Map<String,Map<String,String>> getDynamicArguments()