net.sf.farrago.plugin
Class FarragoAbstractPluginBase

java.lang.Object
  extended by net.sf.farrago.plugin.FarragoAbstractPluginBase
Direct Known Subclasses:
MedAbstractBase

public class FarragoAbstractPluginBase
extends Object

FarragoAbstractPluginBase is an abstract base for classes used to build implementations of FarragoPlugin. Instances of this class are not necessarily direct implementations of the FarragoPlugin interface itself; they may be sub-components of the plugin.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/plugin/FarragoAbstractPluginBase.java#15 $
Author:
John V. Sichi

Field Summary
static String[] BOOLEAN_CHOICES_DEFAULT_FALSE
           
static String[] BOOLEAN_CHOICES_DEFAULT_TRUE
           
static DriverPropertyInfo[] EMPTY_DRIVER_PROPERTIES
          A zero-length array of DriverPropertyInfo.
 
Constructor Summary
FarragoAbstractPluginBase()
           
 
Method Summary
static boolean getBooleanProperty(Properties props, String propName, boolean defaultValue)
          Gets the value of a boolean property, or a default value if the property does not exist.
static byte getByteProperty(Properties props, String propName, byte defaultValue)
          Gets the value of a byte property.
static double getDoubleProperty(Properties props, String propName, double defaultValue)
          Gets the value of an double property.
static float getFloatProperty(Properties props, String propName, float defaultValue)
          Gets the value of an float property.
static int getIntProperty(Properties props, String propName, int defaultValue)
          Gets the value of an integer property.
static long getLongProperty(Properties props, String propName, long defaultValue)
          Gets the value of a long integer property.
static short getShortProperty(Properties props, String propName, short defaultValue)
          Gets the value of an short property.
static void requireProperty(Properties props, String propName)
          Verifies that a property has been set, throwing an exception if has not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_DRIVER_PROPERTIES

public static final DriverPropertyInfo[] EMPTY_DRIVER_PROPERTIES
A zero-length array of DriverPropertyInfo.


BOOLEAN_CHOICES_DEFAULT_FALSE

public static final String[] BOOLEAN_CHOICES_DEFAULT_FALSE

BOOLEAN_CHOICES_DEFAULT_TRUE

public static final String[] BOOLEAN_CHOICES_DEFAULT_TRUE
Constructor Detail

FarragoAbstractPluginBase

public FarragoAbstractPluginBase()
Method Detail

requireProperty

public static void requireProperty(Properties props,
                                   String propName)
Verifies that a property has been set, throwing an exception if has not.

Parameters:
props - properties to check
propName - name of required property
Throws:
EigenbaseException - if property is not set

getLongProperty

public static long getLongProperty(Properties props,
                                   String propName,
                                   long defaultValue)
Gets the value of a long integer property.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value
Throws:
EigenbaseException - if property is set with non-integer value

getIntProperty

public static int getIntProperty(Properties props,
                                 String propName,
                                 int defaultValue)
Gets the value of an integer property.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value
Throws:
EigenbaseException - if property is set with non-integer value

getShortProperty

public static short getShortProperty(Properties props,
                                     String propName,
                                     short defaultValue)
Gets the value of an short property.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value
Throws:
EigenbaseException - if property is set with non-short value

getByteProperty

public static byte getByteProperty(Properties props,
                                   String propName,
                                   byte defaultValue)
Gets the value of a byte property.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value
Throws:
EigenbaseException - if property is set with non-short value

getFloatProperty

public static float getFloatProperty(Properties props,
                                     String propName,
                                     float defaultValue)
Gets the value of an float property.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value
Throws:
EigenbaseException - if property is set with non-short value

getDoubleProperty

public static double getDoubleProperty(Properties props,
                                       String propName,
                                       double defaultValue)
Gets the value of an double property.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value
Throws:
EigenbaseException - if property is set with non-short value

getBooleanProperty

public static boolean getBooleanProperty(Properties props,
                                         String propName,
                                         boolean defaultValue)
Gets the value of a boolean property, or a default value if the property does not exist. Returns true if the property exists, and its value is 1, t, true or yes; the default value if it does not exist; false otherwise.

Parameters:
props - property set
propName - name of property
defaultValue - value to return if property is not set
Returns:
property value