Celtix User APIs

org.objectweb.celtix.configuration
Interface Configuration

All Known Implementing Classes:
org.objectweb.celtix.bus.configuration.AbstractConfigurationImpl, ApplicationConfiguration

public interface Configuration


Method Summary
 boolean getBoolean(String name)
          Convenience method to extract the value of a boolean type configuration item from its holder object.
 Configuration getChild(String namespaceURI, Object id)
          Returns the child configuration of the type specified in the namespaceURI and with the specified identifier if there is one, otherwise null.
 double getDouble(String name)
          Convenience method to extract the value of a double type configuration item from its holder object.
 float getFloat(String name)
          Convenience method to extract the value of a float type configuration item from its holder object.
 Object getId()
          Returns the identifier for this configuration instance (unique within all instances configuration instances for the same metadata model).
 int getInt(String name)
          Convenience method to extract the value of an int type configuration item from its holder object.
 long getLong(String name)
          Convenience method to extract the value of a long type configuration item from its holder object.
 ConfigurationMetadata getModel()
          Returns the configuration metadata model for this Configuration.
<T> T
getObject(Class<T> cls, String name)
          Returns the object holding the value for the configuration item with the specified name.
 Object getObject(String name)
          Returns the object holding the value for the configuration item with the specified name.
 Configuration getParent()
          Returns the parent configuration of this configuration, or null if there is no parent.
 List<ConfigurationProvider> getProviders()
          Returns the list of configuration providers for this configuration.
 short getShort(String name)
          Convenience method to extract the value of a short type configuration item from its holder object.
 String getString(String name)
          Convenience method to extract the value of a string type configuration item from its holder object.
 List<String> getStringList(String name)
          Convenience method to extract the value of a string list type configuration item from its holder object.
 void setProviders(List<ConfigurationProvider> providers)
          Sets the list of configuration providers for this configuration - these will be consulted in orde when looking up the value for a particular configuration item.
 

Method Detail

getId

Object getId()
Returns the identifier for this configuration instance (unique within all instances configuration instances for the same metadata model).

Returns:
the name for this configuration.

getModel

ConfigurationMetadata getModel()
Returns the configuration metadata model for this Configuration.

Returns:
the configuration metadata model.

setProviders

void setProviders(List<ConfigurationProvider> providers)
Sets the list of configuration providers for this configuration - these will be consulted in orde when looking up the value for a particular configuration item.

Parameters:
providers - the configuration providers to use for this configuration.

getProviders

List<ConfigurationProvider> getProviders()
Returns the list of configuration providers for this configuration.

Returns:
the list of configuration providers for this configuration.

getParent

Configuration getParent()
Returns the parent configuration of this configuration, or null if there is no parent.

Returns:
the parent configuration.

getChild

Configuration getChild(String namespaceURI,
                       Object id)
Returns the child configuration of the type specified in the namespaceURI and with the specified identifier if there is one, otherwise null.

Parameters:
id - the identifier of the child configuration.
Returns:
the configuration metadata model.

getObject

Object getObject(String name)
Returns the object holding the value for the configuration item with the specified name. The runtime class of this object is determined by the jaxb mapping of the configuration item's type, e.g. for a boolean item it is an instance of java.lang.Boolean.

Parameters:
name - the name of the configuration item.
Returns:
the object holding the configuration item's value.
Throws:
ConfigurationException - if no such item is defined in this configuration's metadata model, or if no value for this item can be found in either this configuration or any of its parent configuration's and if no default value is specified for the item in the metadata model.

getObject

<T> T getObject(Class<T> cls,
                String name)
Returns the object holding the value for the configuration item with the specified name. The runtime class of this object is determined by the jaxb mapping of the configuration item's type, e.g. for a boolean item it is an instance of java.lang.Boolean.

Parameters:
name - the name of the configuration item.
cls - the class of the configuration item.
Returns:
the object holding the configuration item's value.
Throws:
ConfigurationException - if no such item is defined in this configuration's metadata model, or if no value for this item can be found in either this configuration or any of its parent configuration's and if no default value is specified for the item in the metadata model.

getBoolean

boolean getBoolean(String name)
Convenience method to extract the value of a boolean type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getShort

short getShort(String name)
Convenience method to extract the value of a short type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getInt

int getInt(String name)
Convenience method to extract the value of an int type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getLong

long getLong(String name)
Convenience method to extract the value of a long type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getFloat

float getFloat(String name)
Convenience method to extract the value of a float type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getDouble

double getDouble(String name)
Convenience method to extract the value of a double type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getString

String getString(String name)
Convenience method to extract the value of a string type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

getStringList

List<String> getStringList(String name)
Convenience method to extract the value of a string list type configuration item from its holder object.

Parameters:
name - the name of the configuration item.
Returns:
the value of the configuration item.

Celtix User APIs