VTT Java
2010 Version

gov.nih.nlm.nls.vtt.Model
Class Configuration

java.lang.Object
  extended by gov.nih.nlm.nls.vtt.Model.Configuration

public class Configuration
extends java.lang.Object

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

Currently, it contains variables of: VTT_DIR, VTT_FILE_DIR, TAGS_FILE, etc..

History:

Version:
V-2010
Author:
NLM NLS Development Team, clu

Field Summary
static java.lang.String AUTO_MODE
          VTT Mode: for automatic find the configuration file from classpath
static java.lang.String BASE_FONT_SIZE
          key for the font size
static java.lang.String FILEPATH_DISPLAY_LENGTH
          key for the path of display length of file path in title
static java.lang.String MARKUP_LENGTH_SIZE
          key for the markup length fix length
static java.lang.String MARKUP_OFFSET_SIZE
          key for the markup offset fix length
static java.lang.String MARKUP_TAG_CATEGORY_SIZE
          key for the markup tag category fix length
static java.lang.String MARKUP_TAG_NAME_SIZE
          key for the markup tag name fix length
static java.lang.String OVERWRITE_SELECT_BACKGROUND_COLOR
          key for the overwrite select markup style: background color
static java.lang.String OVERWRITE_SELECT_BOLD
          key for the overwrite select markup style: bold
static java.lang.String OVERWRITE_SELECT_FONT
          key for the overwrite select markup style: font
static java.lang.String OVERWRITE_SELECT_ITALIC
          key for the overwrite select markup style: italic
static java.lang.String OVERWRITE_SELECT_SIZE
          key for the overwrite select markup style: SIZE
static java.lang.String OVERWRITE_SELECT_TEXT_COLOR
          key for the overwrite select markup style: text color
static java.lang.String OVERWRITE_SELECT_UNDERLINE
          key for the overwrite select markup style: underline
static java.lang.String SELECT_BACKGROUND_COLOR_B
          key for the select markup style: background color: blue
static java.lang.String SELECT_BACKGROUND_COLOR_G
          key for the select markup style: background color: green
static java.lang.String SELECT_BACKGROUND_COLOR_R
          key for the select markup style: background color: red
static java.lang.String SELECT_BOLD
          key for the select markup style: bold
static java.lang.String SELECT_FONT
          key for the select markup style: font
static java.lang.String SELECT_ITALIC
          key for the select markup style: italic
static java.lang.String SELECT_SIZE
          key for the select markup style: size
static java.lang.String SELECT_TEXT_COLOR_B
          key for the select markup style: text color: blue
static java.lang.String SELECT_TEXT_COLOR_G
          key for the select markup style: text color: green
static java.lang.String SELECT_TEXT_COLOR_R
          key for the select markup style: text color: red
static java.lang.String SELECT_UNDERLINE
          key for the select markup style: underline
static java.lang.String TAGS_FILE
          key for the path of default tags file defined in conf file
static java.lang.String USE_TEXT_TAG_FOR_NOT_DISPLAY_SELECT_MARKUP
          key for use non-display tag instead of text tag in select markup
static java.lang.String USER_NAME
          key for the username defined in conf file
static java.lang.String VTT_DIR
          key for the path of VTT directory defined in configuration file
static java.lang.String VTT_FILE_DIR
          key for the path of VTT files locate in conf file
static java.lang.String VTT_FORMAT
          key for the readable format
static java.lang.String ZOOM_FACTOR
          key for the zoom factor
 
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 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 values of configuration variables when they are specified in the properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTO_MODE

public static final java.lang.String AUTO_MODE
VTT Mode: for automatic find the configuration file from classpath

See Also:
Constant Field Values

VTT_DIR

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

See Also:
Constant Field Values

VTT_FILE_DIR

public static final java.lang.String VTT_FILE_DIR
key for the path of VTT files locate in conf file

See Also:
Constant Field Values

TAGS_FILE

public static final java.lang.String TAGS_FILE
key for the path of default tags file defined in conf file

See Also:
Constant Field Values

USER_NAME

public static final java.lang.String USER_NAME
key for the username defined in conf file

See Also:
Constant Field Values

FILEPATH_DISPLAY_LENGTH

public static final java.lang.String FILEPATH_DISPLAY_LENGTH
key for the path of display length of file path in title

See Also:
Constant Field Values

BASE_FONT_SIZE

public static final java.lang.String BASE_FONT_SIZE
key for the font size

See Also:
Constant Field Values

ZOOM_FACTOR

public static final java.lang.String ZOOM_FACTOR
key for the zoom factor

See Also:
Constant Field Values

VTT_FORMAT

public static final java.lang.String VTT_FORMAT
key for the readable format

See Also:
Constant Field Values

MARKUP_OFFSET_SIZE

public static final java.lang.String MARKUP_OFFSET_SIZE
key for the markup offset fix length

See Also:
Constant Field Values

MARKUP_LENGTH_SIZE

public static final java.lang.String MARKUP_LENGTH_SIZE
key for the markup length fix length

See Also:
Constant Field Values

MARKUP_TAG_NAME_SIZE

public static final java.lang.String MARKUP_TAG_NAME_SIZE
key for the markup tag name fix length

See Also:
Constant Field Values

MARKUP_TAG_CATEGORY_SIZE

public static final java.lang.String MARKUP_TAG_CATEGORY_SIZE
key for the markup tag category fix length

See Also:
Constant Field Values

OVERWRITE_SELECT_BOLD

public static final java.lang.String OVERWRITE_SELECT_BOLD
key for the overwrite select markup style: bold

See Also:
Constant Field Values

OVERWRITE_SELECT_ITALIC

public static final java.lang.String OVERWRITE_SELECT_ITALIC
key for the overwrite select markup style: italic

See Also:
Constant Field Values

OVERWRITE_SELECT_UNDERLINE

public static final java.lang.String OVERWRITE_SELECT_UNDERLINE
key for the overwrite select markup style: underline

See Also:
Constant Field Values

OVERWRITE_SELECT_FONT

public static final java.lang.String OVERWRITE_SELECT_FONT
key for the overwrite select markup style: font

See Also:
Constant Field Values

OVERWRITE_SELECT_SIZE

public static final java.lang.String OVERWRITE_SELECT_SIZE
key for the overwrite select markup style: SIZE

See Also:
Constant Field Values

OVERWRITE_SELECT_TEXT_COLOR

public static final java.lang.String OVERWRITE_SELECT_TEXT_COLOR
key for the overwrite select markup style: text color

See Also:
Constant Field Values

OVERWRITE_SELECT_BACKGROUND_COLOR

public static final java.lang.String OVERWRITE_SELECT_BACKGROUND_COLOR
key for the overwrite select markup style: background color

See Also:
Constant Field Values

USE_TEXT_TAG_FOR_NOT_DISPLAY_SELECT_MARKUP

public static final java.lang.String USE_TEXT_TAG_FOR_NOT_DISPLAY_SELECT_MARKUP
key for use non-display tag instead of text tag in select markup

See Also:
Constant Field Values

SELECT_BOLD

public static final java.lang.String SELECT_BOLD
key for the select markup style: bold

See Also:
Constant Field Values

SELECT_ITALIC

public static final java.lang.String SELECT_ITALIC
key for the select markup style: italic

See Also:
Constant Field Values

SELECT_UNDERLINE

public static final java.lang.String SELECT_UNDERLINE
key for the select markup style: underline

See Also:
Constant Field Values

SELECT_FONT

public static final java.lang.String SELECT_FONT
key for the select markup style: font

See Also:
Constant Field Values

SELECT_SIZE

public static final java.lang.String SELECT_SIZE
key for the select markup style: size

See Also:
Constant Field Values

SELECT_TEXT_COLOR_R

public static final java.lang.String SELECT_TEXT_COLOR_R
key for the select markup style: text color: red

See Also:
Constant Field Values

SELECT_TEXT_COLOR_G

public static final java.lang.String SELECT_TEXT_COLOR_G
key for the select markup style: text color: green

See Also:
Constant Field Values

SELECT_TEXT_COLOR_B

public static final java.lang.String SELECT_TEXT_COLOR_B
key for the select markup style: text color: blue

See Also:
Constant Field Values

SELECT_BACKGROUND_COLOR_R

public static final java.lang.String SELECT_BACKGROUND_COLOR_R
key for the select markup style: background color: red

See Also:
Constant Field Values

SELECT_BACKGROUND_COLOR_G

public static final java.lang.String SELECT_BACKGROUND_COLOR_G
key for the select markup style: background color: green

See Also:
Constant Field Values

SELECT_BACKGROUND_COLOR_B

public static final java.lang.String SELECT_BACKGROUND_COLOR_B
key for the select markup style: background color: blue

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 configuration file from class path
Method Detail

GetConfiguration

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

Parameters:
key - key (name) of the configuration value to 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 values of configuration variables when they are 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 VTT_DIR, VTT_FILE_DIR, TAGS_FILE

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

VTT Java
2010 Version

Submit a bug or feature

Copyright © 2010 National Library of Medicine