com.ibm.workflow.portlet.client
Class Config

java.lang.Object
  |
  +--com.ibm.workflow.portlet.client.Config

public final class Config
extends java.lang.Object

This class provides access to the settings in the servlet configuration file.

See the CommandHandlerAdapter sample for how to use this class to access settings for custom handlers or viewers.


Method Summary
 ApplicationContext getContext()
          Query the application context.
 java.lang.String getFilename()
          Query the name of the configuration file.
 java.lang.String getParameter(java.lang.String section, java.lang.String key)
          Query the value of a String parameter in the servlet configuration file.
 boolean getParameter(java.lang.String section, java.lang.String key, boolean defaultValue)
          Query the value of a boolean parameter in the servlet configuration file.
 java.lang.String getParameter(java.lang.String section, java.lang.String key, java.lang.String defaultValue)
          Query the value of a String parameter in the servlet configuration file.
 java.util.Hashtable getParameters(java.lang.String section)
          Query all keys in a given section of the servlet configuration file.
 java.util.Hashtable getSections()
          Query all sections in the servlet configuration file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFilename

public java.lang.String getFilename()
Query the name of the configuration file.
Returns:
the name of the servlet's configuration file.

getContext

public ApplicationContext getContext()
Query the application context.
Returns:
the servlet's application context

getSections

public java.util.Hashtable getSections()
Query all sections in the servlet configuration file. The sections returned are not ordered.
Returns:
a table of strings denoting the section names or null if the configuration file is empty

getParameters

public java.util.Hashtable getParameters(java.lang.String section)
Query all keys in a given section of the servlet configuration file. The parameters returned are not ordered.
Parameters:
section - the name of the section
Returns:
a table of strings denoting the key names in section or null if there is no such section

getParameter

public java.lang.String getParameter(java.lang.String section,
                                     java.lang.String key)
Query the value of a String parameter in the servlet configuration file.
Parameters:
section - the name of the section to look in
key - the name of the parameter to look up
Returns:
the value of parameter key or null if there is no such parameter

getParameter

public java.lang.String getParameter(java.lang.String section,
                                     java.lang.String key,
                                     java.lang.String defaultValue)
Query the value of a String parameter in the servlet configuration file.
Parameters:
section - the name of the section to look in
key - the name of the parameter to look up
defaultValue - the value to return if key does not exist
Returns:
the value of parameter key or defaultValue if there is no such parameter

getParameter

public boolean getParameter(java.lang.String section,
                            java.lang.String key,
                            boolean defaultValue)
Query the value of a boolean parameter in the servlet configuration file.
Parameters:
section - the name of the section to look in
key - the name of the parameter to look up
defaultValue - the value to return if key does not exist
Returns:
the value of parameter key (see java.lang.Boolean.valueOf()) or defaultValue if there is no such parameter


© Copyright IBM Corporation 2002, 2007. All Rights Reserved.