tauZaman
v0.1

tauzaman.property
Class PropertyRepository

java.lang.Object
  |
  +--tauzaman.property.PropertyRepository

public class PropertyRepository
extends java.lang.Object

PropertyRepository class manages a pool of Properties. For example:

    PropertyRepository cr = new PropertyRepository();
    // null means load every single Property in the url
    cr.loadProperty(new URL("http://www.eecs.wsu.edu/~burgun/defaultProperties.xml"), null);
 
For now it does not have unloadProperty() behavior.

See Also:
Property
Status:
design complete, implementation complete

Field Summary
private static java.lang.String[] propertyNames
          All currently avaliable Property names
private  java.util.Hashtable propertyRepository
          Hashtable, which has url and name of a Property as keys and their corresponding Property object as values.
 
Constructor Summary
PropertyRepository()
          Constructs a PropertyRepository object.
 
Method Summary
 boolean isValidPropertyName(java.lang.String propertyName)
          Returns true if given property name is one of the valid names.
 Property[] loadProperty(java.net.URL url, java.lang.String[] names)
          Loads Property(ies) into this PropertyRepository and also returns them.
private  java.util.Vector loadPropertyInternal(java.net.URL url, java.lang.String[] names, boolean dflt)
          Loads Property(ies) into this PropertyRepository and also returns them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyRepository

private java.util.Hashtable propertyRepository
Hashtable, which has url and name of a Property as keys and their corresponding Property object as values.


propertyNames

private static java.lang.String[] propertyNames
All currently avaliable Property names

Constructor Detail

PropertyRepository

public PropertyRepository()
Constructs a PropertyRepository object.

Method Detail

isValidPropertyName

public boolean isValidPropertyName(java.lang.String propertyName)
Returns true if given property name is one of the valid names. False otherwise.

Parameters:
propertyName - String name of the Property being checked
Returns:
boolean, which is true if given property name is valid false otherwise

loadProperty

public Property[] loadProperty(java.net.URL url,
                               java.lang.String[] names)
                        throws PropertyFormationException
Loads Property(ies) into this PropertyRepository and also returns them.

Parameters:
url - URL pointing to Property Specification file
names - String names of the Property(ies) that are wanted to be loaded
Returns:
an array of Property(ies) loaded
Throws:
PropertyFormationException - if any abnormal condition occurs when forming Property(ies)

loadPropertyInternal

private java.util.Vector loadPropertyInternal(java.net.URL url,
                                              java.lang.String[] names,
                                              boolean dflt)
                                       throws PropertyFormationException
Loads Property(ies) into this PropertyRepository and also returns them.

Parameters:
url - URL pointing to Property Specification file
names - String names of the Property(ies) that are wanted to be loaded
dflt - boolean representing the default behavior
Returns:
a dynamic array of Property(ies) loaded
Throws:
PropertyFormationException - if any abnormal condition occurs when forming Property(ies) (internal use only)

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project