dk.deepthought.sidious.util
Class RuleProperty

java.lang.Object
  extended by dk.deepthought.sidious.util.RuleProperty

public class RuleProperty
extends java.lang.Object

This class retrieves the appropriate properties for a given Rule.

Author:
Deepthought

Field Summary
private static org.apache.commons.logging.Log logger
          Logger for this class
private  java.util.Properties properties
          Internal properties file.
private static java.lang.String RULES_PROPERTIES_PATH
          The path to the folder where properties files for the Rules are stored.
 
Constructor Summary
RuleProperty(java.util.Properties properties)
          Constructs a new RuleProperty from the input Properties.
RuleProperty(java.lang.String className)
          Constructs a new RuleProperty from the input class name.
 
Method Summary
 double getFloat(java.lang.String key, double defaultValue)
          Method returns the value of the specified key.
 SuperLinkID getID(java.lang.String key)
          Method returns the value of the specified key.
 int getInt(java.lang.String key, int defaultValue)
          Method returns the value of the specified key.
private  java.util.Properties readProperties(java.lang.String prefixName)
          Method returns the Properties object specified by the input name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
Logger for this class


properties

private final java.util.Properties properties
Internal properties file.


RULES_PROPERTIES_PATH

private static final java.lang.String RULES_PROPERTIES_PATH
The path to the folder where properties files for the Rules are stored.

See Also:
Constant Field Values
Constructor Detail

RuleProperty

public RuleProperty(java.lang.String className)
Constructs a new RuleProperty from the input class name.

Parameters:
className - the name of the class

RuleProperty

public RuleProperty(java.util.Properties properties)
Constructs a new RuleProperty from the input Properties.

Parameters:
properties - the properties
Method Detail

readProperties

private java.util.Properties readProperties(java.lang.String prefixName)
Method returns the Properties object specified by the input name.

Parameters:
prefixName - prefix of the properties file
Returns:
the properties of the input object name

getFloat

public double getFloat(java.lang.String key,
                       double defaultValue)
Method returns the value of the specified key.

Parameters:
key - the key
defaultValue - the default value, if retrieved value was not a double
Returns:
the retrieved value

getInt

public int getInt(java.lang.String key,
                  int defaultValue)
Method returns the value of the specified key.

NOTE: The RuleProperty.getFloat() is utilized for retrieval.

Parameters:
key - the key
defaultValue - the default value, if retrieved value was not an int
Returns:
the retrieved value

getID

public SuperLinkID getID(java.lang.String key)
Method returns the value of the specified key.

Parameters:
key - the key
Returns:
the retrieved value


Copyright © Deepthought Development - All Rights Reserved.