Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.common
Class ParameterTable

    java.lang.Object
      java.util.Dictionary<K,V>
          java.util.Hashtable
              oracle.ifs.common.ParameterTable

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, java.util.Map

    public class ParameterTable

extends java.util.Hashtable

A ParameterTable manages a list of named parameters in a Hashtable.

It extends java.util.Hashtable by providing a constructor to convert from a String [] of args in the forms of "key=value", where value can represent a string, integer, long, or boolean.

This class is used parsing command line and parameter file based args. It is typically used for command line type programs, and for constructing tests,

See Also:
  Serialized Form
(Published)

Field Summary
`static java.lang.String` | `s_ExplicitEmptyStringIndicator`

Constructor Summary
`ParameterTable()` Constructs a ParameterTable.
`ParameterTable(java.lang.String filename)` Constructs a ParameterTable, from the contents of a file.
`ParameterTable(java.lang.String[] args)` Constructs a ParameterTable.
`ParameterTable(java.lang.String[] args, java.io.Reader reader)` Constructs a ParameterTable from command-line arguments and the contents of a Reader.
`ParameterTable(java.lang.String[] args, java.lang.String filenameParameter)` Constructs a ParameterTable.
`ParameterTable(java.lang.String[] args, java.lang.String filenameParameter, java.lang.String includePathParameter)` Constructs a ParameterTable.

Method Summary
`void` | `addValue(java.lang.String name, java.lang.String svalue, boolean isConcat, boolean isSection, boolean shouldOverwrite)` Add or overwrite an entry in the ParameterTable
`static java.lang.String` | `getArgumentName(java.lang.String arg)` Static method to return the name portion of the passed name/value pair, of the form =.
`static java.lang.String` | `getArgumentStringValue(java.lang.String arg)` Static method to return the value portion of the passed name/value pair.
`java.lang.Boolean` | `getBoolean(java.lang.String name)` Returns a Boolean object representing the first occurance of the passed name in an name/value pair.
`boolean` | `getBoolean(java.lang.String name, boolean defaultValue)` Returns a boolean representing the first occurance of the passed name in an name/value pair.
`java.lang.String` | `getCurrentSection()` Return the nmae of the section currently in effect.
`java.lang.String[]` | `getEntries(java.lang.String[] omittedKeys)`
`java.lang.Integer` | `getInteger(java.lang.String name)` Returns an Integer object representing the first occurance of the passed name in an name/value pair.
`int` | `getInteger(java.lang.String name, int defaultValue)` Returns an int representing the first occurance of the passed name in an name/value pair.
`java.lang.String[]` | `getKeys()` Return the keys that are represented by this ParameterTable, in the order in which they were added.
`java.lang.Long` | `getLong(java.lang.String name)` Returns an Long object representing the first occurance of the passed name in an name/value pair.
`long` | `getLong(java.lang.String name, long defaultValue)` Returns an long representing the first occurance of the passed name in an name/value pair.
`java.lang.String[]` | `getSectionEntries()`
`java.lang.String[]` | `getSectionKeys()` Return the section keys that are represented by this ParameterTable, in the order in which they were added.
`java.lang.String` | `getString(java.lang.String name)` Returns a String object representing the first occurance of the passed name in an name/value pair.
`java.lang.String` | `getString(java.lang.String name, java.lang.String defaultValue)` Returns a String object representing the first occurance of the passed name in an name/value pair.
`java.lang.String[]` | `getStrings(java.lang.String name)` Returns a Strings array object for a named parameter.
`static java.lang.String[]` | `getStringsFromArrayToken(java.lang.String token)` Get String array from a value of the form "{value1, value2, value3}".
`static java.lang.String[]` | `getStringsFromArrayToken(java.lang.String token, java.lang.String delim)` Get String array from a value of the form "{value1 value2 value3}".
`java.lang.String[]` | `getTokenList(java.lang.String tokenlist)` Parse string into tokens.
`java.lang.String[]` | `getTokenList(java.lang.String tokenlist, int minArraySize)` Parse string into tokens.
`protected void` | `initParameterTable(java.lang.String filename, java.lang.String[] includePaths)` Reads the parameter file and adds the name/value pairs there to our hashtable.
`static boolean` | `isArgumentConcatenation(java.lang.String arg)` Static method to return an indication of whether the name/value pair was assigned with a concatenation operator, "+=".
`static boolean` | `isSectionKey(java.lang.String arg)` Static method to return an indication of whether the name/value pair is actually a section key, a square-bracketed id.
`static java.lang.String[]` | `parseTokenList(java.lang.String tokenlist)` Parse string into tokens.
`static java.lang.String[]` | `parseTokenList(java.lang.String tokenlist, int minArraySize)` Parse string into tokens.
`java.util.Hashtable` | `promoteSection(java.lang.String sectionName)` Promote the specified section, so that settings in the section override any settings of the same name in the main section.
`java.util.Hashtable` | `setSection(java.lang.String sectionName)` Set the parameter section.
`java.lang.String` | `toString()` Provide String representation of this object.

Methods inherited from class java.util.Hashtable
`clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### s_ExplicitEmptyStringIndicator

    public static final java.lang.String s_ExplicitEmptyStringIndicator

See Also:
  Constant Field Values

Constructor Detail

### ParameterTable

    public ParameterTable()

  Constructs a ParameterTable.

  (Unpublished)

### ParameterTable

    public ParameterTable(java.lang.String[] args)

  Constructs a ParameterTable.

  This constructor creates a new ParameterTable from a array of Strings in the format name=value.

  Parameters:
    `args` - commandline arguments, in the form of name=value
  (Unpublished)

### ParameterTable

    public ParameterTable(java.lang.String filename)

  Constructs a ParameterTable, from the contents of a file.

  Parameters:
    `filename` - absolute or relative path to a file.
  (Unpublished)

### ParameterTable

    public ParameterTable(java.lang.String[] args,
                          java.lang.String filenameParameter)

  Constructs a ParameterTable.

  The items in the ParameterTable can be obtained from either an array of name/value pairs or a file containing a set of name/value pairs, one per line.

  For example, `new ParameterTable(new String[] { "foo=1", "bar=2", "myParameterFile=Test.def" }, "myParameterFile")` constructs a ParameterTable containing values for `foo`, `bar`, plus whatever name/value pairs are in the file `Test.def`.

  Items in the array of name/value pairs always override like-named parameters in the file.

  Parameters:
    `args` - a set of name/value pairs, in the form `name=value`
    `filenameParameter` - the name of the parameter whose value is the name of a file containing a set of name/value pairs
  (Published)

### ParameterTable

    public ParameterTable(java.lang.String[] args,
                          java.lang.String filenameParameter,
                          java.lang.String includePathParameter)

  Constructs a ParameterTable.

  This constructor behaves as the above one, but allows specification of the includepath parameter.

  Parameters:
    `args` - commandline arguments, in the form of name=value
    `filenameParameter` - string used to denote a parameter file.
    `includePathParameter` - string used to denote the include path parameter
  (Unpublished)

### ParameterTable

    public ParameterTable(java.lang.String[] args,
                          java.io.Reader reader)

  Constructs a ParameterTable from command-line arguments and the contents of a Reader.

  Parameters:
    `args` - a set of name/value pairs, in the form `name=value`
    `reader` - the Reader of like-formatted name/value pairs
  (Unpublished)

Method Detail

### initParameterTable

    protected void initParameterTable(java.lang.String filename,
                                      java.lang.String[] includePaths)

  Description copied from class: `ParameterTable`
  Reads the parameter file and adds the name/value pairs there to our hashtable.

  Parameters:
    `filename` - a FileReader class that is opened.
    `includePaths` - the included paths
  (Unpublished)

### setSection

    public java.util.Hashtable setSection(java.lang.String sectionName)

  Description copied from class: `ParameterTable`
  Set the parameter section. If null is specified, use the global section.

  Parameters:
    `sectionName` - The section name.
  Returns:
    the hashtable that corresponds to this section; or null if the section name is invalid.
  (Unpublished)

### getCurrentSection

    public java.lang.String getCurrentSection()

  Description copied from class: `ParameterTable`
  Return the nmae of the section currently in effect.

  Returns:
    The current section name.
  (Unpublished)

### promoteSection

    public java.util.Hashtable promoteSection(java.lang.String sectionName)

  Description copied from class: `ParameterTable`
  Promote the specified section, so that settings in the section override any settings of the same name in the main section.

  Parameters:
    `sectionName` - The section name.
  Returns:
    the hashtable that corresponds to this section; or this if the section name is invalid.
  (Unpublished)

### getString

    public java.lang.String getString(java.lang.String name)

  Description copied from class: `ParameterTable`
  Returns a String object representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found null is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
  Returns:
    A String object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getString

    public java.lang.String getString(java.lang.String name,
                                      java.lang.String defaultValue)

  Description copied from class: `ParameterTable`
  Returns a String object representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found, the specified default value is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
    `defaultValue` - Value to reutn if name is not found
  Returns:
    A String object corresponding to the name's value, or defaultValue if the name cannot be found.
  (Published)

### getStrings

    public java.lang.String[] getStrings(java.lang.String name)

  Description copied from class: `ParameterTable`
  Returns a Strings array object for a named parameter. If the value was not multivalued, just return an array with one element.

  Parameters:
    `name` - The parameter name in a name value pair.
  Returns:
    A String array corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getInteger

    public java.lang.Integer getInteger(java.lang.String name)

  Description copied from class: `ParameterTable`
  Returns an Integer object representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found null is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
  Returns:
    An Integer object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getInteger

    public int getInteger(java.lang.String name,
                          int defaultValue)

  Description copied from class: `ParameterTable`
  Returns an int representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found, the default value is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
    `defaultValue` - Default value if name is not found.
  Returns:
    An Integer object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getLong

    public java.lang.Long getLong(java.lang.String name)

  Description copied from class: `ParameterTable`
  Returns an Long object representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found null is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
  Returns:
    An Long object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getLong

    public long getLong(java.lang.String name,
                        long defaultValue)

  Description copied from class: `ParameterTable`
  Returns an long representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found, the default value is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
    `defaultValue` - Default value if name is not found.
  Returns:
    An Long object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getBoolean

    public java.lang.Boolean getBoolean(java.lang.String name)

  Description copied from class: `ParameterTable`
  Returns a Boolean object representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found null is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
  Returns:
    A Boolean object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getBoolean

    public boolean getBoolean(java.lang.String name,
                              boolean defaultValue)

  Description copied from class: `ParameterTable`
  Returns a boolean representing the first occurance of the passed name in an name/value pair. If no parameter matching the name can be found, the default value is returned.

  Parameters:
    `name` - The parameter name in a name value pair.
    `defaultValue` - Default value if name is not found.
  Returns:
    A Boolean object corresponding to the name's value, or null if the name cannot be found.
  (Published)

### getArgumentName

    public static java.lang.String getArgumentName(java.lang.String arg)

  Description copied from class: `ParameterTable`
  Static method to return the name portion of the passed name/value pair, of the form =. The method returns a String.

  Parameters:
    `arg` - Name or name/value pair.
  Returns:
    A String object representing the name.
  (Unpublished)

### isArgumentConcatenation

    public static boolean isArgumentConcatenation(java.lang.String arg)

  Description copied from class: `ParameterTable`
  Static method to return an indication of whether the name/value pair was assigned with a concatenation operator, "+=".

  Parameters:
    `arg` - Name or name/value pair.
  Returns:
    true if the operator specified is +=
  (Unpublished)

### isSectionKey

    public static boolean isSectionKey(java.lang.String arg)

  Description copied from class: `ParameterTable`
  Static method to return an indication of whether the name/value pair is actually a section key, a square-bracketed id.

  Parameters:
    `arg` - Name or name/value pair.
  Returns:
    true if the operator specified is a section key
  (Unpublished)

### getArgumentStringValue

    public static java.lang.String getArgumentStringValue(java.lang.String arg)

  Description copied from class: `ParameterTable`
  Static method to return the value portion of the passed name/value pair. The method returns the value as a String object. If no value is present null is returned. The argument string is in the form of =.

  Parameters:
    `arg` - Name or name/value pair.
  Returns:
    A String object representing the value, or null.
  (Unpublished)

### addValue

    public void addValue(java.lang.String name,
                         java.lang.String svalue,
                         boolean isConcat,
                         boolean isSection,
                         boolean shouldOverwrite)

  Description copied from class: `ParameterTable`
  Add or overwrite an entry in the ParameterTable

  Parameters:
    `name` - Name of the entry
    `svalue` - Sting value of the entry
    `isConcat` - True if the entry is an array entry.
    `isSection` - True if the entry is a section entry.
    `shouldOverwrite` - True if an existing entry is overwritten by this entry.
  (Unpublished)

### getEntries

    public java.lang.String[] getEntries(java.lang.String[] omittedKeys)

### getSectionEntries

    public java.lang.String[] getSectionEntries()

### getKeys

    public java.lang.String[] getKeys()

  Description copied from class: `ParameterTable`
  Return the keys that are represented by this ParameterTable, in the order in which they were added. Section keys are not included in the returned array of keys.

  Returns:
    the array of keys
  (Published)

### getSectionKeys

    public java.lang.String[] getSectionKeys()

  Description copied from class: `ParameterTable`
  Return the section keys that are represented by this ParameterTable, in the order in which they were added.

  Returns:
    the array of section keys
  (Published)

### parseTokenList

    public static java.lang.String[] parseTokenList(java.lang.String tokenlist)

  Description copied from class: `ParameterTable`
  Parse string into tokens.

  Delegates to `getTokenList` with a default ParameterTable instance.

  (Unpublished)

### parseTokenList

    public static java.lang.String[] parseTokenList(java.lang.String tokenlist,
                                                    int minArraySize)

  Description copied from class: `ParameterTable`
  Parse string into tokens.

  Delegates to `getTokenList` with a default ParameterTable instance.

  (Unpublished)

### getTokenList

    public java.lang.String[] getTokenList(java.lang.String tokenlist)

  Description copied from class: `ParameterTable`
  Parse string into tokens.

  Return an array of tokens, some of which may be null. An empty token (e.g. "") is stored in the array as a null. A double quote (") is used to completely enclose any arbitrary token. Whitespace is used to separate any unquoted token. Quotes can appear enclosed in a quoted string by doubling them (e.g. "cat ""and"" dog" would get parsed to cat "and" dog).

  (Unpublished)

### getTokenList

    public java.lang.String[] getTokenList(java.lang.String tokenlist,
                                           int minArraySize)

  Description copied from class: `ParameterTable`
  Parse string into tokens. Return an array of tokens, some of which may be null. An empty token (e.g. "") is stored in the array as a null. A double quote (") is used to completely enclose any arbitrary token. Whitespace is used to separate any unquoted token. Quotes can appear enclosed in a quoted string by doubling them (e.g. "cat ""and"" dog" would get parsed to cat "and" dog).

  (Unpublished)

### toString

    public java.lang.String toString()

  Description copied from class: `ParameterTable`
  Provide String representation of this object.

  Overrides:
    `toString` in class `java.util.Hashtable`
  Returns:
    String representation of this instance

### getStringsFromArrayToken

    public static java.lang.String[] getStringsFromArrayToken(java.lang.String token)

  Description copied from class: `ParameterTable`
  Get String array from a value of the form "{value1, value2, value3}".

  A single comma is treated as the delimiter.

  Parameters:
    `token` - the string token
  Returns:
    the corresponding array

### getStringsFromArrayToken

    public static java.lang.String[] getStringsFromArrayToken(java.lang.String token,
                                                              java.lang.String delim)

  Description copied from class: `ParameterTable`
  Get String array from a value of the form "{value1 value2 value3}".

  The specified string is used as the delimiter.

  Parameters:
    `token` - the string token
    `delim` - the delimiter
  Returns:
    the corresponding array

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD