LexAccess Java
2005 Version

gov.nih.nlm.nls.lexAccess.Lib
Class Configuration

java.lang.Object
  |
  +--gov.nih.nlm.nls.lexAccess.Lib.Configuration

public class Configuration
extends java.lang.Object

This class provides a way of storing and retrieving configurations through a Configuation object.

Currently, it contains variables of: LA_DIR, IDB_PROPERTY_FILE, ...

History:

Version:
V-2005
Author:
NLM NLS Development Team

Field Summary
static java.lang.String DB_DRIVER
          Java Data base Connectivity Driver
static java.lang.String DB_HOST
          Database host name
static java.lang.String DB_NAME
          Database name
static java.lang.String DB_PASSWORD
          Database password
static java.lang.String DB_TYPE
          Data base
static java.lang.String DB_USERNAME
          Database user name
static java.lang.String JDBC_URL
          Java Data Base Connectivity URL
static java.lang.String LA_DIR
          key for the path of LVG directory defined in configuration file
static java.lang.String NO_OUTPUT_MSG
          No records found message
 
Constructor Summary
Configuration(java.lang.String fName, boolean useClassPath)
          Create a Configuration object.
 
Method Summary
 java.lang.String GetConfiguration(java.lang.String key)
          Get a value from configuration file by specifying the key.
static java.lang.String OverWriteProperty(java.lang.String key, Configuration conf, java.util.Hashtable properties)
          Get a value from configuration file by specifying the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LA_DIR

public static final java.lang.String LA_DIR
key for the path of LVG directory defined in configuration file

See Also:
Constant Field Values

DB_TYPE

public static final java.lang.String DB_TYPE
Data base

See Also:
Constant Field Values

DB_DRIVER

public static final java.lang.String DB_DRIVER
Java Data base Connectivity Driver

See Also:
Constant Field Values

JDBC_URL

public static final java.lang.String JDBC_URL
Java Data Base Connectivity URL

See Also:
Constant Field Values

DB_HOST

public static final java.lang.String DB_HOST
Database host name

See Also:
Constant Field Values

DB_NAME

public static final java.lang.String DB_NAME
Database name

See Also:
Constant Field Values

DB_USERNAME

public static final java.lang.String DB_USERNAME
Database user name

See Also:
Constant Field Values

DB_PASSWORD

public static final java.lang.String DB_PASSWORD
Database password

See Also:
Constant Field Values

NO_OUTPUT_MSG

public static final java.lang.String NO_OUTPUT_MSG
No records found message

See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration(java.lang.String fName,
                     boolean useClassPath)
Create a Configuration object. There are two ways of reading configuration files. First, finding xxx.properties from Java classpath. Second, finding file by the specified path.

Parameters:
fName - the path of the configuration file or base name when using class path.
useClassPath - a flag of finding configurationfile from class path
Method Detail

GetConfiguration

public java.lang.String GetConfiguration(java.lang.String key)
Get a value from configuration file by specifying the key.

Parameters:
key - key (name) of the configuration value to be get
Returns:
the value of the configuration item in a string format

OverWriteProperty

public static java.lang.String OverWriteProperty(java.lang.String key,
                                                 Configuration conf,
                                                 java.util.Hashtable properties)
Get a value from configuration file by specifying the key. Overwrite the value if it is specified in the properties.

Parameters:
key - key (name) of the configuration value to be get
Returns:
the value of the configuration item in a string format

LexAccess Java
2005 Version

Submit a bug or feature

Copyright © 2005 National Library of Medicine