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

## com.sun.jini.config
Class Config

    java.lang.Object
      com.sun.jini.config.Config

public class Config
extends Object

Provides static methods for getting entries from a `Configuration`. This class cannot be instantiated.

This class uses the `Logger` named `net.jini.config` to log information at the following logging levels:

Level | Description
--- | ---
FINE | entries that are found, but do not meet the specified constraints (e.g. are null)

Since:
  2.0

Method Summary
`static float` | `getFloatEntry(Configuration config, String component, String name, float defaultValue, float min, float max)` Obtains a `float` that falls within the given inclusive range from the specified `Configuration` using the specified component and entry names.
`static int` | `getIntEntry(Configuration config, String component, String name, int defaultValue, int min, int max)` Obtains an `int` that falls within the given inclusive range from the specified `Configuration` using the specified component and entry names.
`static long` | `getLongEntry(Configuration config, String component, String name, long defaultValue, long min, long max)` Obtains a `long` that falls within the given inclusive range from the specified `Configuration` using the specified component and entry names.
`static Object` | `getNonNullEntry(Configuration config, String component, String name, Class type)` Obtains a non-`null` object from the specified `Configuration` using the specified arguments.
`static Object` | `getNonNullEntry(Configuration config, String component, String name, Class type, Object defaultValue)` Obtains a non-`null` object from the specified `Configuration` using the specified arguments.
`static Object` | `getNonNullEntry(Configuration config, String component, String name, Class type, Object defaultValue, Object data)` Obtains a non-`null` object from the specified `Configuration` using the specified arguments.

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

Method Detail

### getNonNullEntry

    public static Object getNonNullEntry(Configuration config,
                                         String component,
                                         String name,
                                         Class type)
                                  throws ConfigurationException

  Obtains a non-`null` object from the specified `Configuration` using the specified arguments.

  Calling this method is equivalent to calling ``getNonNullEntry`(config, component, name, type, `Configuration.NO_DEFAULT`, `Configuration.NO_DATA`)`.

  Parameters:
    `config` - the `Configuration` being consulted.
    `component` - the component being configured
    `name` - the name of the entry for the component
    `type` - the type of the object to be returned
  Returns:
    a non-`null` object obtained from calling `config.getEntry` using the other passed arguments
  Throws:
    `NoSuchEntryException` - if the underlying call to `config.getEntry` does
    `ConfigurationException` - if the underlying call to `config.getEntry` does, or if the returned entry is `null`. Any `Error` thrown while creating the object is propagated to the caller; it is not wrapped in a `ConfigurationException`
    `IllegalArgumentException` - if the underlying call to `config.getEntry` does
    `NullPointerException` - if any of the arguments are `null`
  See Also:
    `Configuration.getEntry(String, String, Class)`, `getNonNullEntry(Configuration, String, String, Class, Object, Object)`

### getNonNullEntry

    public static Object getNonNullEntry(Configuration config,
                                         String component,
                                         String name,
                                         Class type,
                                         Object defaultValue)
                                  throws ConfigurationException

  Obtains a non-`null` object from the specified `Configuration` using the specified arguments.

  Calling this method is equivalent to calling ``getNonNullEntry`(config, component, name, type, defaultValue, `Configuration.NO_DATA`)`.

  Parameters:
    `config` - the `Configuration` being consulted.
    `component` - the component being configured
    `name` - the name of the entry for the component
    `type` - the type of the object to be returned
    `defaultValue` - the object to return if no matching entry is found
  Returns:
    a non-`null` object obtained from calling `config.getEntry` using the other passed arguments
  Throws:
    `NoSuchEntryException` - if the underlying call to `config.getEntry` does
    `ConfigurationException` - if the underlying call to `config.getEntry` does, or if the returned entry is `null`. Any `Error` thrown while creating the object is propagated to the caller; it is not wrapped in a `ConfigurationException`
    `IllegalArgumentException` - if the underlying call to `config.getEntry` does
    `NullPointerException` - if any of the arguments are `null`
  See Also:
    `Configuration.getEntry(String, String, Class, Object, Object)`, `getNonNullEntry(Configuration, String, String, Class, Object, Object)`

### getNonNullEntry

    public static Object getNonNullEntry(Configuration config,
                                         String component,
                                         String name,
                                         Class type,
                                         Object defaultValue,
                                         Object data)
                                  throws ConfigurationException

  Obtains a non-`null` object from the specified `Configuration` using the specified arguments.

  Calling this method is equivalent to calling `config.`getEntry`(component, name, type, defaultValue, data)` after ensuring that `defaultValue` is non-`null` and throwing `ConfigurationException` if the result is `null`.

  Parameters:
    `config` - the `Configuration` being consulted.
    `component` - the component being configured
    `name` - the name of the entry for the component
    `type` - the type of the object to be returned
    `defaultValue` - the object to return if no matching entry is found
    `data` - an object to use when computing the value of the entry, or `Configuration#NO_DATA` to specify no data
  Returns:
    a non-`null` object obtained from calling `config.getEntry` using the other passed arguments
  Throws:
    `NoSuchEntryException` - if the underlying call to `config.getEntry` does
    `ConfigurationException` - if the underlying call to `config.getEntry` does, or if the returned entry is `null`. Any `Error` thrown while creating the object is propagated to the caller; it is not wrapped in a `ConfigurationException`
    `IllegalArgumentException` - if the underlying call to `config.getEntry` does
    `NullPointerException` - if the `config`, `component`, `name`, `type`, or `defaultValue` arguments are `null`
  See Also:
    `Configuration.getEntry(String, String, Class, Object, Object)`, `getNonNullEntry(Configuration, String, String, Class, Object, Object)`

### getLongEntry

    public static long getLongEntry(Configuration config,
                                    String component,
                                    String name,
                                    long defaultValue,
                                    long min,
                                    long max)
                             throws ConfigurationException

  Obtains a `long` that falls within the given inclusive range from the specified `Configuration` using the specified component and entry names.

  Parameters:
    `config` - the `Configuration` being consulted.
    `component` - the component being configured
    `name` - the name of the entry for the component
    `defaultValue` - the `long` to return if no matching entry is found
    `min` - the minimum value the entry should have
    `max` - the maximum value the entry should have
  Returns:
    a long obtained from calling `config.getEntry` using `component`, `name`, and `defaultValue`.
  Throws:
    `NoSuchEntryException` - if the underlying call to `config.getEntry` does
    `ConfigurationException` - if the underlying call to `config.getEntry` does, or if the returned entry is `null`, or if returned value is not between `min` and `max`, inclusive. Any `Error` thrown while creating the object is propagated to the caller; it is not wrapped in a `ConfigurationException`
    `IllegalArgumentException` - if the underlying call to `config.getEntry` does, if `defaultValue` is not between `min` and `max` inclusive, or if `min` is larger than `max`
    `NullPointerException` - if `config`, `component` or `name` is `null`.
  See Also:
    `Configuration.getEntry(String, String, Class, Object)`

### getIntEntry

    public static int getIntEntry(Configuration config,
                                  String component,
                                  String name,
                                  int defaultValue,
                                  int min,
                                  int max)
                           throws ConfigurationException

  Obtains an `int` that falls within the given inclusive range from the specified `Configuration` using the specified component and entry names.

  Parameters:
    `config` - the `Configuration` being consulted.
    `component` - the component being configured
    `name` - the name of the entry for the component
    `defaultValue` - the `int` to return if no matching entry is found
    `min` - the minimum value the entry should have
    `max` - the maximum value the entry should have
  Returns:
    a int obtained from calling `config.getEntry` using `component`, `name`, and `defaultValue`.
  Throws:
    `NoSuchEntryException` - if the underlying call to `config.getEntry` does
    `ConfigurationException` - if the underlying call to `config.getEntry` does, or if the returned entry is `null`, or if returned value is not between `min` and `max`, inclusive. Any `Error` thrown while creating the object is propagated to the caller; it is not wrapped in a `ConfigurationException`
    `IllegalArgumentException` - if the underlying call to `config.getEntry` does, if `defaultValue` is not between `min` and `max` inclusive, or if `min` is larger than `max`
    `NullPointerException` - if `config`, `component` or `name` is `null`.
  See Also:
    `Configuration.getEntry(String, String, Class, Object)`

### getFloatEntry

    public static float getFloatEntry(Configuration config,
                                      String component,
                                      String name,
                                      float defaultValue,
                                      float min,
                                      float max)
                               throws ConfigurationException

  Obtains a `float` that falls within the given inclusive range from the specified `Configuration` using the specified component and entry names.

  Parameters:
    `config` - the `Configuration` being consulted.
    `component` - the component being configured
    `name` - the name of the entry for the component
    `defaultValue` - the `float` to return if no matching entry is found
    `min` - the minimum value the entry should have
    `max` - the maximum value the entry should have
  Returns:
    a float obtained from calling `config.getEntry` using `component`, `name`, and `defaultValue`.
  Throws:
    `NoSuchEntryException` - if the underlying call to `config.getEntry` does
    `ConfigurationException` - if the underlying call to `config.getEntry` does, or if the returned entry is `null`, or if returned value is not between `min` and `max`, inclusive. Any `Error` thrown while creating the object is propagated to the caller; it is not wrapped in a `ConfigurationException`
    `IllegalArgumentException` - if the underlying call to `config.getEntry` does, if `defaultValue` is not between `min` and `max` inclusive, or if `min` is larger than `max`
    `NullPointerException` - if `config`, `component` or `name` is `null`.
  See Also:
    `Configuration.getEntry(String, String, Class, Object)`

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 © 2004 Sun Microsystems, Inc. All rights reserved