org.vizzini.util
Class ConfigUtilities

java.lang.Object
  extended by org.vizzini.util.ConfigUtilities

public class ConfigUtilities
extends Object

Provides convenience methods for processing configuration properties.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
protected static void checkInputs(Properties properties, String propertyName)
          Check the validity of the input arguments.
 boolean getBooleanProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 boolean getBooleanProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 Class getClassProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 Class getClassProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 Dimension getDimensionProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 Dimension getDimensionProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 double[] getDoubleArrayProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 double[] getDoubleArrayProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 double getDoubleProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 double getDoubleProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
static ConfigUtilities getInstance()
          Return the singleton instance of this class.
 int[] getIntArrayProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 int[] getIntArrayProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 int getIntProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 int getIntProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
protected static int getIntProperty(Properties properties, String propertyName, boolean isRequired, int defaultValue)
          Return the value specified by the given property name from the given properties.
 int getIntProperty(Properties properties, String propertyName, int defaultValue)
          Return the value specified by the given property name from the given properties.
 long getLongProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 long getLongProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 Object getObjectProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 Object getObjectProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 String getStringProperty(Properties properties, String propertyName)
          Return the required value specified by the given property name from the given properties.
 String getStringProperty(Properties properties, String propertyName, boolean isRequired)
          Return the value specified by the given property name from the given properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConfigUtilities getInstance()
Return the singleton instance of this class.

Returns:
The single instance.
Since:
v0.3

getBooleanProperty

public boolean getBooleanProperty(Properties properties,
                                  String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getBooleanProperty

public boolean getBooleanProperty(Properties properties,
                                  String propertyName,
                                  boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getClassProperty

public Class getClassProperty(Properties properties,
                              String propertyName)
                       throws InstantiationException,
                              IllegalAccessException
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.2

getClassProperty

public Class getClassProperty(Properties properties,
                              String propertyName,
                              boolean isRequired)
                       throws InstantiationException,
                              IllegalAccessException
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.2

getDimensionProperty

public Dimension getDimensionProperty(Properties properties,
                                      String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getDimensionProperty

public Dimension getDimensionProperty(Properties properties,
                                      String propertyName,
                                      boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getDoubleArrayProperty

public double[] getDoubleArrayProperty(Properties properties,
                                       String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getDoubleArrayProperty

public double[] getDoubleArrayProperty(Properties properties,
                                       String propertyName,
                                       boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getDoubleProperty

public double getDoubleProperty(Properties properties,
                                String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getDoubleProperty

public double getDoubleProperty(Properties properties,
                                String propertyName,
                                boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getIntArrayProperty

public int[] getIntArrayProperty(Properties properties,
                                 String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getIntArrayProperty

public int[] getIntArrayProperty(Properties properties,
                                 String propertyName,
                                 boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getIntProperty

public int getIntProperty(Properties properties,
                          String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getIntProperty

public int getIntProperty(Properties properties,
                          String propertyName,
                          boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getIntProperty

public int getIntProperty(Properties properties,
                          String propertyName,
                          int defaultValue)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
defaultValue - Default value.
Since:
v0.2

getLongProperty

public long getLongProperty(Properties properties,
                            String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getLongProperty

public long getLongProperty(Properties properties,
                            String propertyName,
                            boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

getObjectProperty

public Object getObjectProperty(Properties properties,
                                String propertyName)
                         throws InstantiationException,
                                IllegalAccessException
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.1

getObjectProperty

public Object getObjectProperty(Properties properties,
                                String propertyName,
                                boolean isRequired)
                         throws InstantiationException,
                                IllegalAccessException
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.1

getStringProperty

public String getStringProperty(Properties properties,
                                String propertyName)
Return the required value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
Since:
v0.1

getStringProperty

public String getStringProperty(Properties properties,
                                String propertyName,
                                boolean isRequired)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.1

checkInputs

protected static void checkInputs(Properties properties,
                                  String propertyName)
Check the validity of the input arguments.

Since:
v0.1

getIntProperty

protected static int getIntProperty(Properties properties,
                                    String propertyName,
                                    boolean isRequired,
                                    int defaultValue)
Return the value specified by the given property name from the given properties.

Parameters:
properties - Source of data.
propertyName - Property name.
isRequired - Flag indicating if the property is required.
Since:
v0.2


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02