Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.conf
Interface Configuration

All Superinterfaces:
  BeanInfo, Cloneable, com.solarmetric.util.Closeable, Serializable

All Known Subinterfaces:
  ClientConfiguration, JDBCConfiguration, JDOConfiguration, JDOConnectionFactory, JDOManagedConnectionFactory

All Known Implementing Classes:
  ConfigurationImpl

public interface Configuration
extends BeanInfo, Serializable, com.solarmetric.util.Closeable, Cloneable

Interface for generic configuration objects. Includes the ability to write configuration to and from `Properties` instances.

Field Summary
`static String` | `ATTRIBUTE_ALLOWED_VALUES` Attribute of returned `Value` property descriptors listing recognized values for the property.
`static String` | `ATTRIBUTE_CATEGORY` Attribute of the returned `Value` property descriptors naming the property' hierarchical category.
`static String` | `ATTRIBUTE_ORDER` Attribute of the returned `Value` property descriptors naming the property's ordering in its category.
`static String` | `ATTRIBUTE_TYPE` Attribute of the returned `Value` property descriptors naming the property's type or category.

Fields inherited from interface java.beans.BeanInfo
`ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32`

Method Summary
`void` | `addPropertyChangeListener(PropertyChangeListener listener)` Adds a listener for any property changes.
`Object` | `clone()` Return a copy of the current configuration.
`void` | `close()` Free the resources used by this object.
`void` | `fromFile(File f)` Fill in properties from the given properties file.
`void` | `fromProperties(Properties properties)` Set this Configuration via the given Properties.
`void` | `fromStream(InputStream in)` Fill in properties from the given properties stream.
`RuntimeException` | `getConfigurationException(String msg, Throwable cause)` Return an appropriate exception indicating a configuration error.
`Log` | `getConfigurationLog()` Return the log to use for configuration messages.
`Log` | `getLog(String category)` Return the log for the given category.
`LogFactory` | `getLogFactory()` The log factory.
`Value` | `getValue(String property)` Return the `Value` for the given property, or null if none.
`Value[]` | `getValues()` Return the set of all `Value`s.
`boolean` | `hasJava5()` Return `true` if this VM has Java 5 features; otherwise returns `false`.
`boolean` | `isFrozen()` Return true if this Configuration has been frozen.
`void` | `removePropertyChangeListener(PropertyChangeListener listener)` Removes a listener for any property changes.
`void` | `setFrozen(boolean frozen)` Lock down the configuration's state.
`void` | `setLogFactory(LogFactory factory)` log factory.
`Properties` | `toProperties(boolean storeDefaults)` A Properties representation of this Configuration.

Methods inherited from interface java.beans.BeanInfo
`getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getPropertyDescriptors`

Field Detail

### ATTRIBUTE_ALLOWED_VALUES

    public static final String ATTRIBUTE_ALLOWED_VALUES

  Attribute of returned `Value` property descriptors listing recognized values for the property.

### ATTRIBUTE_TYPE

    public static final String ATTRIBUTE_TYPE

  Attribute of the returned `Value` property descriptors naming the property's type or category.

### ATTRIBUTE_CATEGORY

    public static final String ATTRIBUTE_CATEGORY

  Attribute of the returned `Value` property descriptors naming the property' hierarchical category.

### ATTRIBUTE_ORDER

    public static final String ATTRIBUTE_ORDER

  Attribute of the returned `Value` property descriptors naming the property's ordering in its category.

Method Detail

### getLogFactory

    public LogFactory getLogFactory()

  The log factory. If no log factory has been set explicitly, this method will create one.

### setLogFactory

    public void setLogFactory(LogFactory factory)

  log factory.

### getLog

    public Log getLog(String category)

  Return the log for the given category.
  See Also:
    `getLogFactory()`

### getValue

    public Value getValue(String property)

  Return the `Value` for the given property, or null if none.

### getValues

    public Value[] getValues()

  Return the set of all `Value`s.

### toProperties

    public Properties toProperties(boolean storeDefaults)

  A Properties representation of this Configuration. Note that changes made to this Properties object will not be automatically reflected in this Configuration object.
  Parameters:
    `storeDefaults` - if true, then properties will be written out even if they match the default value for a property

### fromProperties

    public void fromProperties(Properties properties)

  Set this Configuration via the given Properties. Any keys missing from the given properties will not be set. Note that changes made to this Properties object will not be automatically reflected in this Configuration object.

### fromStream

    public void fromStream(InputStream in)
                    throws IOException

  Fill in properties from the given properties stream.

### fromFile

    public void fromFile(File f)
                  throws IOException

  Fill in properties from the given properties file.

### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener listener)

  Adds a listener for any property changes. The property events fired will not include the old value.
  Parameters:
    `listener` - the listener to receive notification of property changes

### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener listener)

  Removes a listener for any property changes.
  Parameters:
    `listener` - the listener to remove

### setFrozen

    public void setFrozen(boolean frozen)

  Lock down the configuration's state. Attempting to set state after a configuration has been frozen results in a `IllegalStateException`.

### isFrozen

    public boolean isFrozen()

  Return true if this Configuration has been frozen.

### close

    public void close()

  Free the resources used by this object.
  Specified by:
    `close` in interface `com.solarmetric.util.Closeable`

### getConfigurationLog

    public Log getConfigurationLog()

  Return the log to use for configuration messages.

### getConfigurationException

    public RuntimeException getConfigurationException(String msg,
                                                      Throwable cause)

  Return an appropriate exception indicating a configuration error. The given cause may be null.

### hasJava5

    public boolean hasJava5()

  Return `true` if this VM has Java 5 features; otherwise returns `false`.

### clone

    public Object clone()

  Return a copy of the current configuration.
  Overrides:
    `clone` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.