be.SIRAPRISE.util
Class CommandLineParameters

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by be.SIRAPRISE.util.CommandLineParameters
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class CommandLineParameters
extends java.util.Properties

Author:
Erwin
See Also:
Serialized Form

Method Summary
static CommandLineParameters getCommandLineParameters(java.lang.String[] args, java.lang.String defaultPropertyName, java.util.Properties defaultProperties)
          Gets a Properties object representing the contents of the command line parameters, with the defaults for the specifyable options held in the given defaultProperties.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getCommandLineParameters

public static CommandLineParameters getCommandLineParameters(java.lang.String[] args,
                                                             java.lang.String defaultPropertyName,
                                                             java.util.Properties defaultProperties)
Gets a Properties object representing the contents of the command line parameters, with the defaults for the specifyable options held in the given defaultProperties.

Command line parameters can be specified using two syntaxes :

  1. optionName(optionValue)
  2. -optionName:OptionValue

There is one option that can be declared the default option. The value for this option can be specified without specifying the option name. E.g. if the default option is FILE, then the following command lines are equivalent :

  1. java JavaMainClass optionValue
  2. java JavaMainClass FILE(optionValue)
  3. java JavaMainClass -FILE:optionValue

Parameters:
args - The command line parameters in String[] format
defaultPropertyName - The name of the property that must not be typed, or null if there is no default property
defaultProperties - The Properties object containing the defaults for the options specifyable through the command line, or null if there are no defaults
Returns:
A parameter map representing the contents of the command line parameters