org.jconfig
Class ExtensibleConfiguration

java.lang.Object
  |
  +--org.jconfig.DefaultConfiguration
        |
        +--org.jconfig.ExtensibleConfiguration
All Implemented Interfaces:
Configuration, java.io.Serializable

public class ExtensibleConfiguration
extends DefaultConfiguration
implements java.io.Serializable

This class is the configuration itself. The Configuration is useful if one wants to manage multiple configurations. A single instance of the Configuration may contain, for example, information for one application or user.

Author:
Andreas Mecky andreas.mecky@xcom.de, Terry Dye terry.dye@xcom.de
See Also:
Serialized Form

Inner classes inherited from class org.jconfig.DefaultConfiguration
DefaultConfiguration.MyCategoryListener
 
Fields inherited from class org.jconfig.DefaultConfiguration
baseConfigName, categories, configName, mainCategory, vm
 
Constructor Summary
ExtensibleConfiguration(java.lang.String configName)
          The constructor that creates a new configuration with one empty category called "general".
 
Method Summary
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue, java.lang.String categoryName)
          This is the real implementation.
 java.lang.String getXMLAsString()
          This method converts the Configuration into a String which looks like XML.
 
Methods inherited from class org.jconfig.DefaultConfiguration
addCategoryListener, addCategoryListener, addConfigurationListener, addInclude, addPropertyListener, addPropertyListener, containsCategory, fireConfigurationChangedEvent, getArray, getArray, getArray, getBooleanProperty, getBooleanProperty, getCategory, getCategory, getCategoryNames, getCharProperty, getCharProperty, getConfigName, getDoubleProperty, getDoubleProperty, getEncoding, getIncludes, getIntProperty, getIntProperty, getLongProperty, getLongProperty, getMainCategoryName, getNumberOfCategories, getProperties, getProperty, getProperty, getPropertyNames, getVariable, getVariables, hasChanged, isNew, markDirty, removeCategory, removeConfigurationListener, removeProperty, removeProperty, resetCreated, setBaseConfiguration, setBooleanProperty, setBooleanProperty, setCategory, setCategory, setCategory, setCharProperty, setCharProperty, setConfigName, setDoubleProperty, setDoubleProperty, setEncoding, setIntProperty, setIntProperty, setLongProperty, setLongProperty, setProperty, setProperty, setVariable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensibleConfiguration

public ExtensibleConfiguration(java.lang.String configName)
The constructor that creates a new configuration with one empty category called "general". This category is also the default category.
Parameters:
configName - the name of the configuration
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue,
                                    java.lang.String categoryName)
Description copied from class: DefaultConfiguration
This is the real implementation. It will return the value of the property with the specific name. First of all, it checks if the name of the category exists. If not, then it will use the name of the default category. The next step is that it will look for the property. If it is not found in the category, it will look inside the default category (inheritance). If it still cannot find the property, it will return the defaultValue
Overrides:
getProperty in class DefaultConfiguration
Following copied from class: org.jconfig.DefaultConfiguration
Parameters:
key - the name of the property
defaultValue - the default value
categoryName - the name of the category
Returns:
the value as String

getXMLAsString

public java.lang.String getXMLAsString()
This method converts the Configuration into a String which looks like XML.
Overrides:
getXMLAsString in class DefaultConfiguration
Returns:
the Configuration as String in XML format


Copyright © 2001-2003 Andreas Mecky, Terry Dye. All Rights Reserved.