se.kmr.scam
Class SCAMProperties

java.lang.Object
  extended byse.kmr.scam.SCAMProperties

public class SCAMProperties
extends Object

This the main property-holder for SCAM. It reads 'scam.properties' from

  1. Package
  2. java.home
  3. classpath
If 'scam.properties' are found in classpath it will override the "earlier" versions.

Title:

Description:

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
jand

Field Summary
static String FILENAME
          The name of the configuration file.
static String RESOURCENAME
           
 
Constructor Summary
SCAMProperties()
           
 
Method Summary
static boolean contains(String key)
          Check if configuration contains the specified key.
static String get(String key)
          Get the corresponding value of the specified key.
static String get(String key, String defaultValue)
          Get the corresponding value of the specified key.
static int getInt(String key)
          Get the corresponding int-value of the specified key.
static int getInt(String key, int defaultValue)
          Get the corresponding int-value of the specified key.
protected static void load()
          Load properties.
static void set(String key, String value)
          Set the value of a key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME

public static final String FILENAME
The name of the configuration file.
 scam.properties
 

See Also:
Constant Field Values

RESOURCENAME

public static final String RESOURCENAME
See Also:
Constant Field Values
Constructor Detail

SCAMProperties

public SCAMProperties()
Method Detail

contains

public static boolean contains(String key)
Check if configuration contains the specified key.

Parameters:
key - Key
Returns:
true if it exists

get

public static String get(String key)
Get the corresponding value of the specified key. If the key does not exist, an Error will be thrown.

Parameters:
key - Key
Returns:
value

get

public static String get(String key,
                         String defaultValue)
Get the corresponding value of the specified key. If the key does not exist, the dafault value will be returned.

Parameters:
key - Key
defaultValue - Default value
Returns:
value

getInt

public static int getInt(String key)
Get the corresponding int-value of the specified key. If the key does not exist, an Error will be thrown.

Parameters:
key - Key
Returns:
int-value
See Also:
get(String)

getInt

public static int getInt(String key,
                         int defaultValue)
Get the corresponding int-value of the specified key. If the key does not exist, the dafault value will be returned.

Parameters:
key - Key
defaultValue - Default value
Returns:
value

set

public static void set(String key,
                       String value)
Set the value of a key.

Parameters:
key - Key
value - Value

load

protected static void load()
Load properties. Called as static upon creation of this class.



Copyright © 2003 SCAM. All Rights Reserved.