TC Java
2011 Version

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

java.lang.Object
  extended by gov.nih.nlm.nls.tc.Lib.Configuration

public class Configuration
extends java.lang.Object

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

History:

Version:
V-2011
Author:
NLM Lexical Systems Group

Field Summary
static java.lang.String AUTO_MODE
           
static java.lang.String CONTRACTIONS_FILE
          key for the path of contractions file defined in conf file
static java.lang.String DATA_DIR
          Data Dir
static java.lang.String DB_DIR
          Data base Dir
static java.lang.String DB_DRIVER
          Java Data base Connectivity Driver
static java.lang.String DB_NAME
          database name
static java.lang.String DB_URL
          Java Data Base Connectivity URL
static java.lang.String JD_FILE
          key for the path of JDs file defined in conf file
static java.lang.String JID_TA_JDS_FILE
          key for the path of JidTaJds file defined in conf file
static java.lang.String NO_OUTPUT_MSG
          No records found message
static java.lang.String RESTRICT_WORDS_FILE
          key for the path of restrictwords file defined in conf file
static java.lang.String ROOT_DIR
          key for the path of root directory defined in configuration file
static java.lang.String ST_FILE
          key for the path of STs file defined in conf file
static java.lang.String ST_JD_FILE
          key for the path of ST-JD file defined in conf file
static java.lang.String STOP_WORDS_FILE
          key for the path of stopwords file defined in conf file
static java.lang.String SUB_HEADINGS_FILE
          key for the path of Subheadings file defined in conf file
static java.lang.String WORD_SIGNAL_WC_DC_FILE
          key for the path of wordSignalWcDc file defined in conf file
 
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.
 java.lang.String GetInformation()
          Get system level information from configuration.
 void OverwriteProperties(java.util.Hashtable<java.lang.String,java.lang.String> properties)
          Overwrite the value if it is specified in the properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_DIR

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

See Also:
Constant Field Values

AUTO_MODE

public static final java.lang.String AUTO_MODE
See Also:
Constant Field Values

DATA_DIR

public static final java.lang.String DATA_DIR
Data Dir

See Also:
Constant Field Values

DB_DIR

public static final java.lang.String DB_DIR
Data base Dir

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

DB_URL

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

See Also:
Constant Field Values

DB_NAME

public static final java.lang.String DB_NAME
database name

See Also:
Constant Field Values

JD_FILE

public static final java.lang.String JD_FILE
key for the path of JDs file defined in conf file

See Also:
Constant Field Values

CONTRACTIONS_FILE

public static final java.lang.String CONTRACTIONS_FILE
key for the path of contractions file defined in conf file

See Also:
Constant Field Values

SUB_HEADINGS_FILE

public static final java.lang.String SUB_HEADINGS_FILE
key for the path of Subheadings file defined in conf file

See Also:
Constant Field Values

STOP_WORDS_FILE

public static final java.lang.String STOP_WORDS_FILE
key for the path of stopwords file defined in conf file

See Also:
Constant Field Values

RESTRICT_WORDS_FILE

public static final java.lang.String RESTRICT_WORDS_FILE
key for the path of restrictwords file defined in conf file

See Also:
Constant Field Values

WORD_SIGNAL_WC_DC_FILE

public static final java.lang.String WORD_SIGNAL_WC_DC_FILE
key for the path of wordSignalWcDc file defined in conf file

See Also:
Constant Field Values

ST_FILE

public static final java.lang.String ST_FILE
key for the path of STs file defined in conf file

See Also:
Constant Field Values

ST_JD_FILE

public static final java.lang.String ST_JD_FILE
key for the path of ST-JD file defined in conf file

See Also:
Constant Field Values

JID_TA_JDS_FILE

public static final java.lang.String JID_TA_JDS_FILE
key for the path of JidTaJds file defined in conf file

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 class path. 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

OverwriteProperties

public void OverwriteProperties(java.util.Hashtable<java.lang.String,java.lang.String> properties)
Overwrite the value if it is specified in the properties.

Parameters:
properties - properties to be overwrite in the configuration

GetInformation

public java.lang.String GetInformation()
Get system level information from configuration. This includes LVG_DIR, DB_TYPE, DB_NAME

Returns:
the value of the configuration item in a string format

TC Java
2011 Version

Submit a bug or feature

Copyright © 2011 National Library of Medicine