Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.util.property
Class PropertyManager

    java.lang.Object
      org.jboss.util.property.PropertyManager

public final class PropertyManager
extends Object

A more robust replacement of `java.lang.System` for property access.

Version:
  `$Revision: 1.4 $`
Author:
  Jason Dillon

Field Summary
`static String` | `DEFAULT_PROPERTY_READER_TOKEN` Token which specifies the default property reader
`static String` | `READER_PROPERTY_NAME` Property reader list property name

Method Summary
`static void` | `addPropertyListener(PropertyListener listener)` Add a property listener.
`static void` | `addPropertyListeners(PropertyListener[] listeners)` Add an array of property listeners.
`static boolean` | `containsProperty(String name)` Check if this map contains a given property.
`static String[]` | `getArrayProperty(String name)` Get an array style property.
`static String[]` | `getArrayProperty(String base, String[] defaultValues)` Get an array style property.
`static PropertyMap` | `getDefaultPropertyMap()` Get the default `PropertyMap`.
`static String` | `getProperty(String name)` Get a property.
`static String` | `getProperty(String name, String defaultValue)` Get a property.
`static PropertyGroup` | `getPropertyGroup(String basename)` Get a property group for the given property base.
`static PropertyGroup` | `getPropertyGroup(String basename, int index)` Get a property group for the given property base at the given index.
`static void` | `load(Map map)` Load properties from a map.
`static void` | `load(PropertyReader reader)` Load properties from a `PropertyReader`.
`static void` | `load(String classname)` Load properties from a `PropertyReader` specifed by the given class name.
`static void` | `load(String prefix, Map map)` Load properties from a map.
`static Iterator` | `names()` Return an iterator over all contained property names.
`static String` | `removeProperty(String name)` Remove a property.
`static boolean` | `removePropertyListener(PropertyListener listener)` Remove a property listener.
`static String` | `setProperty(String name, String value)` Set a property.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### READER_PROPERTY_NAME

    public static final String READER_PROPERTY_NAME

  Property reader list property name

  See Also:
    Constant Field Values

### DEFAULT_PROPERTY_READER_TOKEN

    public static final String DEFAULT_PROPERTY_READER_TOKEN

  Token which specifies the default property reader

  See Also:
    Constant Field Values

Method Detail

### getDefaultPropertyMap

    public static PropertyMap getDefaultPropertyMap()

  Get the default `PropertyMap`.

  Returns:
    Default `PropertyMap`.

### addPropertyListener

    public static void addPropertyListener(PropertyListener listener)

  Add a property listener.

  Parameters:
    `listener` - Property listener to add.

### addPropertyListeners

    public static void addPropertyListeners(PropertyListener[] listeners)

  Add an array of property listeners.

  Parameters:
    `listeners` - Array of property listeners to add.

### removePropertyListener

    public static boolean removePropertyListener(PropertyListener listener)

  Remove a property listener.

  Parameters:
    `listener` - Property listener to remove.
  Returns:
    True if listener was removed.

### load

    public static void load(String prefix,
                            Map map)
                     throws PropertyException

  Load properties from a map.

  Parameters:
    `prefix` - Prefix to append to all map keys (or `null`).
    `map` - Map containing properties to load.
  Throws:
    `PropertyException`

### load

    public static void load(Map map)
                     throws PropertyException,
                            IOException

  Load properties from a map.

  Parameters:
    `map` - Map containing properties to load.
  Throws:
    `PropertyException`
    `IOException`

### load

    public static void load(PropertyReader reader)
                     throws PropertyException,
                            IOException

  Load properties from a `PropertyReader`.

  Parameters:
    `reader` - `PropertyReader` to read properties from.
  Throws:
    `PropertyException`
    `IOException`

### load

    public static void load(String classname)
                     throws PropertyException,
                            IOException

  Load properties from a `PropertyReader` specifed by the given class name.

  Parameters:
    `classname` - Class name of a `PropertyReader` to read from.
  Throws:
    `PropertyException`
    `IOException`

### setProperty

    public static String setProperty(String name,
                                     String value)

  Set a property.

  Parameters:
    `name` - Property name.
    `value` - Property value.
  Returns:
    Previous property value or `null`.

### removeProperty

    public static String removeProperty(String name)

  Remove a property.

  Parameters:
    `name` - Property name.
  Returns:
    Removed property value or `null`.

### getProperty

    public static String getProperty(String name,
                                     String defaultValue)

  Get a property.

  Parameters:
    `name` - Property name.
    `defaultValue` - Default property value.
  Returns:
    Property value or default.

### getProperty

    public static String getProperty(String name)

  Get a property.

  Parameters:
    `name` - Property name.
  Returns:
    Property value or `null`.

### getArrayProperty

    public static String[] getArrayProperty(String base,
                                            String[] defaultValues)

  Get an array style property.

  Parameters:
    `base` - Base property name.
    `defaultValues` - Default property values.
  Returns:
    Array of property values or default.

### getArrayProperty

    public static String[] getArrayProperty(String name)

  Get an array style property.

  Parameters:
    `name` - Property name.
  Returns:
    Array of property values or empty array.

### names

    public static Iterator names()

  Return an iterator over all contained property names.

  Returns:
    Property name iterator.

### containsProperty

    public static boolean containsProperty(String name)

  Check if this map contains a given property.

  Parameters:
    `name` - Property name.
  Returns:
    True if contains property.

### getPropertyGroup

    public static PropertyGroup getPropertyGroup(String basename)

  Get a property group for the given property base.

  Parameters:
    `basename` - Base property name.
  Returns:
    Property group.

### getPropertyGroup

    public static PropertyGroup getPropertyGroup(String basename,
                                                 int index)

  Get a property group for the given property base at the given index.

  Parameters:
    `basename` - Base property name.
    `index` - Array property index.
  Returns:
    Property group.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.