uk.co.jcp.util.properties
Class PropertyManager

java.lang.Object
  |
  +--uk.co.jcp.util.properties.PropertyManager

public class PropertyManager
extends java.lang.Object

Contains a set of static accessor methods for using a PropertyFactoryRegistry


Method Summary
static JCPProperties getInstance(java.lang.String source)
          Get an instance of JCPProperties from the default provider
static JCPProperties getInstance(java.lang.String source, JCPProperties parentProperties)
          Get an instance of JCPProperties from the default provider
static JCPProperties getInstance(java.lang.String resource, java.lang.String source)
          Get an instance of JCPProperties from a specific provider
static JCPProperties getInstance(java.lang.String resource, java.lang.String source, JCPProperties parentProperties)
          Get an instance of JCPProperties from a specific provider
 boolean isRegistered(java.lang.String resource)
          Determine if the property factory for the named rsource has been registered
static void registerPropertyFactory(JCPPropertyFactory factory)
          Register a property factory
static void setDefaultPropertyFactory(JCPPropertyFactory factory)
          Set the default property factory.
static void setRegistry(JCPPropertyFactoryRegistry registry)
          Set the registry instance that the manager uses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setRegistry

public static void setRegistry(JCPPropertyFactoryRegistry registry)
Set the registry instance that the manager uses

getInstance

public static JCPProperties getInstance(java.lang.String source)
                                 throws PropertyException
Get an instance of JCPProperties from the default provider
Parameters:
source - the identifier for the property source (e.g. a filename)
Returns:
an instance of JCPProperties
Throws:
PropertyException - if the instance couple not be created

getInstance

public static JCPProperties getInstance(java.lang.String source,
                                        JCPProperties parentProperties)
                                 throws PropertyException
Get an instance of JCPProperties from the default provider
Parameters:
source - the identifier for the property source (e.g. a filename)
parentProperties - another properties object from which the new object will inherit values
Returns:
an instance of JCPProperties
Throws:
PropertyException - if the instance couple not be created

getInstance

public static JCPProperties getInstance(java.lang.String resource,
                                        java.lang.String source)
                                 throws PropertyException
Get an instance of JCPProperties from a specific provider
Parameters:
resource - the identifier for the property resource (e.g. "INI")
source - the identifier for the property source (e.g. a filename)
Returns:
an instance of JCPProperties
Throws:
PropertyException - if the instance couple not be created

getInstance

public static JCPProperties getInstance(java.lang.String resource,
                                        java.lang.String source,
                                        JCPProperties parentProperties)
                                 throws PropertyException
Get an instance of JCPProperties from a specific provider
Parameters:
resource - the identifier for the property resource (e.g. "INI")
source - the identifier for the property source (e.g. a filename)
parentProperties - another properties object from which the new object will inherit values
Returns:
an instance of JCPProperties
Throws:
PropertyException - if the instance couple not be created

registerPropertyFactory

public static void registerPropertyFactory(JCPPropertyFactory factory)
Register a property factory
Parameters:
factory - the factory to register

setDefaultPropertyFactory

public static void setDefaultPropertyFactory(JCPPropertyFactory factory)
                                      throws PropertyException
Set the default property factory. Can only be set once.
Parameters:
factory - the factory to register
Throws:
PropertyException - if the default has already been set

isRegistered

public boolean isRegistered(java.lang.String resource)
Determine if the property factory for the named rsource has been registered
Parameters:
resource - the name of the resource
Returns:
true if the resource factory has been registered