mro.util.properties
Class PropertiesPool

java.lang.Object
  extended by mro.util.properties.PropertiesPool

public class PropertiesPool
extends java.lang.Object

A class that handles several Properties. The Properties are stored mapped to the owning objects class name. Note: Only handles one Properties per class name, meaning that you can not have several instances of the same class. You can receive all Properties for a super class, that is a Properties for each sub class.

See Also:
Properties

Field Summary
private  java.util.HashMap<java.lang.String,Properties> classNamePropertiesMap
           
private  XMLFileFilter xmlFF
           
 
Constructor Summary
PropertiesPool()
           
PropertiesPool(PropertiesPool pool)
           
 
Method Summary
 Properties getPropertiesForObject(java.lang.Object o)
          Returns the Properties stored for the class of the specified object.
 Properties getPropertiesWithClassName(java.lang.String className)
          Returns the Properties for the class with the given name, null if there is not any such Properties.
 java.util.Vector<Properties> getPropertiesWithSuperClassName(java.lang.String superClassName)
          Returns a Vector of Properties, with those Properties that store info on classes with the (by name) given super class.
 void loadPropertiesInDirectory(java.io.File dir)
          Loads all Properties stored as files in a directory.
 void loadPropertiesInDirectory(java.lang.String dirName)
          Loads all Properties stored as files in a directory.
 void printClassNames()
          For debugging purposes.
 void savePropertiesToDirectory(java.io.File dir)
          Saves all Properties as files in a directory.
 void savePropertiesToDirectory(java.lang.String dirName)
          Saves all Properties as files in a directory.
 int size()
          Returns the number of Properties in this PropertiesPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classNamePropertiesMap

private java.util.HashMap<java.lang.String,Properties> classNamePropertiesMap

xmlFF

private XMLFileFilter xmlFF
Constructor Detail

PropertiesPool

public PropertiesPool()

PropertiesPool

public PropertiesPool(PropertiesPool pool)
Method Detail

loadPropertiesInDirectory

public void loadPropertiesInDirectory(java.lang.String dirName)
                               throws java.io.IOException,
                                      org.xml.sax.SAXException
Loads all Properties stored as files in a directory.

Throws:
java.io.IOException
org.xml.sax.SAXException

loadPropertiesInDirectory

public void loadPropertiesInDirectory(java.io.File dir)
                               throws java.io.IOException,
                                      org.xml.sax.SAXException
Loads all Properties stored as files in a directory. Reads only files with the ".xml"-extension.

Throws:
java.io.IOException
org.xml.sax.SAXException

savePropertiesToDirectory

public void savePropertiesToDirectory(java.lang.String dirName)
                               throws java.io.IOException
Saves all Properties as files in a directory.

Throws:
java.io.IOException

savePropertiesToDirectory

public void savePropertiesToDirectory(java.io.File dir)
                               throws java.io.IOException
Saves all Properties as files in a directory.

Throws:
java.io.IOException

getPropertiesWithSuperClassName

public java.util.Vector<Properties> getPropertiesWithSuperClassName(java.lang.String superClassName)
Returns a Vector of Properties, with those Properties that store info on classes with the (by name) given super class. Returns null if the superclass does not exist.


getPropertiesWithClassName

public Properties getPropertiesWithClassName(java.lang.String className)
Returns the Properties for the class with the given name, null if there is not any such Properties.


getPropertiesForObject

public Properties getPropertiesForObject(java.lang.Object o)
Returns the Properties stored for the class of the specified object.


size

public int size()
Returns the number of Properties in this PropertiesPool.


printClassNames

public void printClassNames()
For debugging purposes.