org.javaWebGen.util
Class PropertiesReader

java.lang.Object
  extended by org.javaWebGen.util.PropertiesReader
All Implemented Interfaces:
java.io.Serializable

public class PropertiesReader
extends java.lang.Object
implements java.io.Serializable

class reads messages from a resource bundle or config properties

Version:
$Revision: 1.2 $
Author:
Kevin Scott
See Also:
Serialized Form

Method Summary
 boolean getBooleanValue(java.lang.String key)
          Returns a value from the StringBundle they matches the key value
 double getDoubleValue(java.lang.String key)
          Returns a value from the StringBundle they matches the key value
 java.lang.String getFormattedMessage(java.lang.String key)
          Returns a value from the StringBundle they matches the key value
 java.lang.String getFormattedMessage(java.lang.String key, java.lang.Object[] parms)
          Returns a value from the StringBundle that matches the key value
 java.lang.String getFormattedMessage(java.lang.String key, java.lang.String parm)
          Returns a value from the StringBundle they matches the key value will also substitute {} with values in a Object Array
 java.lang.String getFormattedMessage(java.lang.String key, java.lang.String parm1, java.lang.String parm2)
          Returns a value from the StringBundle they matches the key value will also substitute {} with values in a Object Array
 java.lang.String getFormattedMessage(java.lang.String key, java.lang.String parm1, java.lang.String parm2, java.lang.String parm3)
          Returns a value from the StringBundle they matches the key value will also substitute {} with values in a Object Array
 long getLongValue(java.lang.String key)
          Returns a value from the StringBundle they matches the key value
 java.lang.String getName()
           
 java.lang.String getProperty(java.lang.String key)
          Returns a value a value from the StringBundle that matches the key value this method is used to get configuration values as opposed to messages like the getMessage method it does not try to format the value returned in any way
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns a value a value from the StringBundle that matches the key value this method is used to get configuration values as opposed to messages like the getMessage method it does not try to format the value returned in any way
static PropertiesReader getReader(java.io.File propertiesFile)
          get a propertiesReader using a file object pointing to a valid file
static PropertiesReader getReader(java.lang.String bundleName)
          get a propertiesReader using a resourse bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getReader

public static PropertiesReader getReader(java.io.File propertiesFile)
                                  throws java.io.IOException
get a propertiesReader using a file object pointing to a valid file

Parameters:
propertiesFile - file object of a valid properties file
Throws:
java.io.IOException

getReader

public static PropertiesReader getReader(java.lang.String bundleName)
                                  throws java.util.MissingResourceException
get a propertiesReader using a resourse bundle

Parameters:
bundleName - name of the resouce bundle
Throws:
java.util.MissingResourceException

getName

public java.lang.String getName()

getBooleanValue

public boolean getBooleanValue(java.lang.String key)
                        throws java.lang.NumberFormatException
Returns a value from the StringBundle they matches the key value

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle in boolean format
Throws:
java.lang.NumberFormatException

getDoubleValue

public double getDoubleValue(java.lang.String key)
                      throws java.lang.NumberFormatException
Returns a value from the StringBundle they matches the key value

Parameters:
key - key to look for in the String Bundle
Returns:
value from the string bundle in double format
Throws:
java.lang.NumberFormatException

getLongValue

public long getLongValue(java.lang.String key)
                  throws java.lang.NumberFormatException
Returns a value from the StringBundle they matches the key value

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle in long format
Throws:
java.lang.NumberFormatException

getFormattedMessage

public java.lang.String getFormattedMessage(java.lang.String key)
Returns a value from the StringBundle they matches the key value

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle

getFormattedMessage

public java.lang.String getFormattedMessage(java.lang.String key,
                                            java.lang.String parm)
Returns a value from the StringBundle they matches the key value will also substitute {} with values in a Object Array

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle
See Also:
MessageFormat

getFormattedMessage

public java.lang.String getFormattedMessage(java.lang.String key,
                                            java.lang.String parm1,
                                            java.lang.String parm2)
Returns a value from the StringBundle they matches the key value will also substitute {} with values in a Object Array

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle
See Also:
MessageFormat

getFormattedMessage

public java.lang.String getFormattedMessage(java.lang.String key,
                                            java.lang.String parm1,
                                            java.lang.String parm2,
                                            java.lang.String parm3)
Returns a value from the StringBundle they matches the key value will also substitute {} with values in a Object Array

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle
See Also:
MessageFormat

getFormattedMessage

public java.lang.String getFormattedMessage(java.lang.String key,
                                            java.lang.Object[] parms)
Returns a value from the StringBundle that matches the key value

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns a value a value from the StringBundle that matches the key value this method is used to get configuration values as opposed to messages like the getMessage method it does not try to format the value returned in any way

Parameters:
key - key to look for in the String Bungle
Returns:
value from the string bundle

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Returns a value a value from the StringBundle that matches the key value this method is used to get configuration values as opposed to messages like the getMessage method it does not try to format the value returned in any way

Parameters:
key - key to look for in the String Bungle
defaultValue - value if not found
Returns:
value from the string bundle


Copyright(C) 2003-2006 Kevin Scott - All Rights Reserved.