|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.PropertiesFactory
The PropertiesFactory is a factory implementation to obtain
property files (*.properties) for an application. Users of this class must
specify an application name by using the setApplicationName(String)
method. Once the name is set, the property file will be of form
applicationname + "." + properties
To obtain an instance of class
PropertiesFile users call the
getPropertiesFile(Object) method.
If you still want to benefit from this factory, but not use the
PropertiesFile class you may invoke
the getFile(String) method.
| Field Summary | |
static java.lang.String |
KEY_PROPERTIES_HOME
The KEY_PROPERTIES_HOME field contains the string
representation for a system key, which specifies the home directory
for property files created by this factory. |
| Method Summary | |
java.io.File |
getFile(java.lang.String filename)
For those components who need to maintain their own files, but still want to benefit from this factory, can obtain a File instance from this method which will ensure, that the file resides in the correct location. |
static PropertiesFactory |
getInstance()
Returns the instance of the Factory. |
PropertiesFile |
getPropertiesFile(java.lang.Object requiresProperties)
This method returns the PropertiesFile instance for an instance
which requires persistent properties. |
static java.lang.String |
internalGetApplicationName()
Internal getter method for the application name |
static void |
setApplicationName(java.lang.String name)
Sets the name of the current application this factory is used in. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String KEY_PROPERTIES_HOME
KEY_PROPERTIES_HOME field contains the string
representation for a system key, which specifies the home directory
for property files created by this factory.If a string is found in the system property to this key, it will be used as home directory for all the property files. Otherwise user home directory is used.
| Method Detail |
public static final PropertiesFactory getInstance()
PropertiesFactory.public static final void setApplicationName(java.lang.String name)
name - The name of the enclosing application as string. (optional)
public final PropertiesFile getPropertiesFile(java.lang.Object requiresProperties)
throws PropertiesFactoryException
PropertiesFile instance for an instance
which requires persistent properties. If this parameter is of type String, the
String itself would be used as filename. Otherwise the package stripped class
name is the filename.
requiresProperties - the object which requires Properties.
PropertiesFile, or the previously
created one.
PropertiesFactoryException - thrown if the file can't be created.
public final java.io.File getFile(java.lang.String filename)
throws PropertiesFactoryException
filename - the target file name.
PropertiesFactoryException - thrown when the file creation fails.public static java.lang.String internalGetApplicationName()
setApplicationName(String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||