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

## org.jboss.remoting.samples.chat.utility
Class Parameters

    java.lang.Object
      org.jboss.remoting.samples.chat.utility.Parameters

    public class Parameters

extends java.lang.Object

Title: chat.utility.Parameters

Description: Manages parameters to the application.

A parameter's value is taken from:

1. the primary source, which is
   - the command line if the program is standalone
   - the `web.conf` file if the program is a servlet
   or, if the parameter is not given in the primary source,
2. a configuration file property with the same name, or, if there is no such configuration file property
3. the default value given in this file, or, if a default value is not given in this file,
4. null

Copyright: Copyright (c) 2004

Version:
  1.0
Author:
  Ron Sigal

Constructor Summary
`Parameters()`

Method Summary
`static java.lang.String` | `getParameter(java.lang.String name)` `getParameter()` returns stored parameter values
`static java.lang.String` | `getParameter(java.lang.String name, java.lang.String defaultValue)` `getParameter()` returns stored parameter values
`static void` | `initParameters(javax.servlet.ServletConfig servletConfig)` `initParameters()` puts parameters into a Hashtable.
`static void` | `initParameters(java.lang.String[] args)` `initParameters()` puts parameters into a Hashtable.
`static void` | `main(java.lang.String[] args)` `main()` implements unit tests.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Parameters

    public Parameters()

Method Detail

### initParameters

    public static void initParameters(java.lang.String[] args)

  `initParameters()` puts parameters into a Hashtable.

  For each element of `args` of the form "string1=string2", the value "string2" is a parameter with key "string1".

  Parameters:
    ``args`:` - an array of Strings. These are meant to be the command line parameters.

### initParameters

    public static void initParameters(javax.servlet.ServletConfig servletConfig)

  `initParameters()` puts parameters into a Hashtable.

  Parameters:
    ``servletConfig/code>:` - the primary source of parameters`

### getParameter

    public static java.lang.String getParameter(java.lang.String name)

  `getParameter()` returns stored parameter values

  Parameters:
    ``name`` - name of parameter whose value is requested
  Returns:
    if `name` is a key in `parameters`, returns the value associated with `name`. Otherwise, returns `null`.

### getParameter

    public static java.lang.String getParameter(java.lang.String name,
                                                java.lang.String defaultValue)

  `getParameter()` returns stored parameter values

  Parameters:
    ``name`` - name of parameter whose value is requested
  Returns:
    if `name` is a key in `parameters`, returns the value associated with `name`. Otherwise, returns `null`.

### main

    public static void main(java.lang.String[] args)

  `main()` implements unit tests.

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

Copyright ? 1998-2005 JBoss Inc . All Rights Reserved.