概述 | 软件包 | 类 | 使用 | 树 | 已过时 | 索引 | 帮助
上一个类 下一个类 | 框架 无框架
摘要： 嵌套 | 字段 | 构造函数 | 方法 | 详细信息： 字段 | 构造函数 | 方法

## tot.xml
接口 Configuration

所有已知实现类：
  AbstractConfiguration, BaseConfiguration, BasePathConfiguration, DOM4JConfiguration, XMLConfiguration

    public interface Configuration

Configuration interface. The general idea here is to make something that will work like our extended properties and be compatible with the preferences API if at all possible.

方法摘要
`void` | `addProperty(java.lang.String key, java.lang.Object value)` Add a property to the configuration.
`void` | `clearProperty(java.lang.String key)` Clear a property in the configuration.
`boolean` | `containsKey(java.lang.String key)` Check if the configuration contains the key.
`boolean` | `getBoolean(java.lang.String key)` Get a boolean associated with the given configuration key.
`boolean` | `getBoolean(java.lang.String key, boolean defaultValue)` Get a boolean associated with the given configuration key.
`java.lang.Boolean` | `getBoolean(java.lang.String key, java.lang.Boolean defaultValue)` Get a boolean associated with the given configuration key.
`byte` | `getByte(java.lang.String key)` Get a byte associated with the given configuration key.
`byte` | `getByte(java.lang.String key, byte defaultValue)` Get a byte associated with the given configuration key.
`java.lang.Byte` | `getByte(java.lang.String key, java.lang.Byte defaultValue)` Get a byte associated with the given configuration key.
`double` | `getDouble(java.lang.String key)` Get a double associated with the given configuration key.
`double` | `getDouble(java.lang.String key, double defaultValue)` Get a double associated with the given configuration key.
`java.lang.Double` | `getDouble(java.lang.String key, java.lang.Double defaultValue)` Get a double associated with the given configuration key.
`float` | `getFloat(java.lang.String key)` Get a float associated with the given configuration key.
`float` | `getFloat(java.lang.String key, float defaultValue)` Get a float associated with the given configuration key.
`java.lang.Float` | `getFloat(java.lang.String key, java.lang.Float defaultValue)` Get a float associated with the given configuration key.
`int` | `getInt(java.lang.String key)` Get a int associated with the given configuration key.
`int` | `getInt(java.lang.String key, int defaultValue)` Get a int associated with the given configuration key.
`java.lang.Integer` | `getInteger(java.lang.String key, java.lang.Integer defaultValue)` Get a int associated with the given configuration key.
`java.util.Iterator` | `getKeys()` Get the list of the keys contained in the configuration repository.
`java.util.Iterator` | `getKeys(java.lang.String prefix)` Get the list of the keys contained in the configuration repository that match the specified prefix.
`long` | `getLong(java.lang.String key)` Get a long associated with the given configuration key.
`long` | `getLong(java.lang.String key, long defaultValue)` Get a long associated with the given configuration key.
`java.lang.Long` | `getLong(java.lang.String key, java.lang.Long defaultValue)` Get a long associated with the given configuration key.
`java.util.Properties` | `getProperties(java.lang.String key)` Get a list of properties associated with the given configuration key.
`java.lang.Object` | `getProperty(java.lang.String key)` Gets a property from the configuration.
`short` | `getShort(java.lang.String key)` Get a short associated with the given configuration key.
`short` | `getShort(java.lang.String key, short defaultValue)` Get a short associated with the given configuration key.
`java.lang.Short` | `getShort(java.lang.String key, java.lang.Short defaultValue)` Get a short associated with the given configuration key.
`java.lang.String` | `getString(java.lang.String key)` Get a string associated with the given configuration key.
`java.lang.String` | `getString(java.lang.String key, java.lang.String defaultValue)` Get a string associated with the given configuration key.
`java.lang.String[]` | `getStringArray(java.lang.String key)` Get an array of strings associated with the given configuration key.
`java.util.Vector` | `getVector(java.lang.String key)` Get a Vector of strings associated with the given configuration key.
`java.util.Vector` | `getVector(java.lang.String key, java.util.Vector defaultValue)` Get a Vector of strings associated with the given configuration key.
`boolean` | `isEmpty()` Check if the configuration is empty.
`void` | `setProperty(java.lang.String key, java.lang.Object value)` Set a property, this will replace any previously set values.
`Configuration` | `subset(java.lang.String prefix)` Create an Configuration object that is a subset of this one.

方法详细信息

### subset

    Configuration subset(java.lang.String prefix)

  Create an Configuration object that is a subset of this one. The new Configuration object contains every key from the current Configuration that starts with prefix. The prefix is removed from the keys in the subset.

  参数：
    `prefix` - The prefix used to select the properties.

### isEmpty

    boolean isEmpty()

  Check if the configuration is empty.

  返回：
    true is the configuration contains no key/value pair, false otherwise

### containsKey

    boolean containsKey(java.lang.String key)

  Check if the configuration contains the key.

  返回：
    true is the configuration contains a value for this key, false otherwise

### addProperty

    void addProperty(java.lang.String key,
                     java.lang.Object value)

  Add a property to the configuration. If it already exists then the value stated here will be added to the configuration entry. For example, if resource.loader = file is already present in the configuration and you addProperty("resource.loader", "classpath") Then you will end up with a Vector like the following: ["file", "classpath"]

  参数：
    `key` - The Key to add the property to.
    `value` - The Value to add.

### setProperty

    void setProperty(java.lang.String key,
                     java.lang.Object value)

  Set a property, this will replace any previously set values. Set values is implicitly a call to clearProperty(key), addProperty(key,value).

  参数：
    `key` - The key of the property to change
    `value` - The new value

### clearProperty

    void clearProperty(java.lang.String key)

  Clear a property in the configuration.

  参数：
    `key` - the key to remove along with corresponding value.

### getProperty

    java.lang.Object getProperty(java.lang.String key)

  Gets a property from the configuration.

  参数：
    `key` - property to retrieve
  返回：
    value as object. Will return user value if exists, if not then default value if exists, otherwise null

### getKeys

    java.util.Iterator getKeys(java.lang.String prefix)

  Get the list of the keys contained in the configuration repository that match the specified prefix.

  参数：
    `prefix` - The prefix to test against.
  返回：
    An Iterator of keys that match the prefix.

### getKeys

    java.util.Iterator getKeys()

  Get the list of the keys contained in the configuration repository.

  返回：
    An Iterator.

### getProperties

    java.util.Properties getProperties(java.lang.String key)

  Get a list of properties associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated properties if key is found.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a String/Vector.
    `java.lang.IllegalArgumentException` - if one of the tokens is malformed (does not contain an equals sign).

### getBoolean

    boolean getBoolean(java.lang.String key)

  Get a boolean associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated boolean.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Boolean.

### getBoolean

    boolean getBoolean(java.lang.String key,
                       boolean defaultValue)

  Get a boolean associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated boolean.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Boolean.

### getBoolean

    java.lang.Boolean getBoolean(java.lang.String key,
                                 java.lang.Boolean defaultValue)

  Get a boolean associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated boolean if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Boolean.

### getByte

    byte getByte(java.lang.String key)

  Get a byte associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated byte.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Byte.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getByte

    byte getByte(java.lang.String key,
                 byte defaultValue)

  Get a byte associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated byte.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Byte.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getByte

    java.lang.Byte getByte(java.lang.String key,
                           java.lang.Byte defaultValue)

  Get a byte associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated byte if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Byte.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getDouble

    double getDouble(java.lang.String key)

  Get a double associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated double.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Double.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getDouble

    double getDouble(java.lang.String key,
                     double defaultValue)

  Get a double associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated double.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Double.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getDouble

    java.lang.Double getDouble(java.lang.String key,
                               java.lang.Double defaultValue)

  Get a double associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated double if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Double.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getFloat

    float getFloat(java.lang.String key)

  Get a float associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated float.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Float.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getFloat

    float getFloat(java.lang.String key,
                   float defaultValue)

  Get a float associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated float.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Float.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getFloat

    java.lang.Float getFloat(java.lang.String key,
                             java.lang.Float defaultValue)

  Get a float associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated float if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Float.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getInt

    int getInt(java.lang.String key)

  Get a int associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated int.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Integer.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getInt

    int getInt(java.lang.String key,
               int defaultValue)

  Get a int associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated int.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Integer.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getInteger

    java.lang.Integer getInteger(java.lang.String key,
                                 java.lang.Integer defaultValue)

  Get a int associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated int if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Integer.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getLong

    long getLong(java.lang.String key)

  Get a long associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated long.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Long.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getLong

    long getLong(java.lang.String key,
                 long defaultValue)

  Get a long associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated long.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Long.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getLong

    java.lang.Long getLong(java.lang.String key,
                           java.lang.Long defaultValue)

  Get a long associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated long if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Long.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getShort

    short getShort(java.lang.String key)

  Get a short associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated short.
  抛出：
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Short.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getShort

    short getShort(java.lang.String key,
                   short defaultValue)

  Get a short associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated short.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Short.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.

### getShort

    java.lang.Short getShort(java.lang.String key,
                             java.lang.Short defaultValue)

  Get a short associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated short if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Short.
    `java.lang.NumberFormatException` - is thrown if the value mapped by the key has not a valid number format.
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.

### getString

    java.lang.String getString(java.lang.String key)

  Get a string associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated string.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a String.
    `java.util.NoSuchElementException` - is thrown if the key doesn't map to an existing object.

### getString

    java.lang.String getString(java.lang.String key,
                               java.lang.String defaultValue)

  Get a string associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated string if key is found and has valid format, default value otherwise.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a String.

### getStringArray

    java.lang.String[] getStringArray(java.lang.String key)

  Get an array of strings associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated string array if key is found.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a String/Vector of Strings.

### getVector

    java.util.Vector getVector(java.lang.String key)

  Get a Vector of strings associated with the given configuration key.

  参数：
    `key` - The configuration key.
  返回：
    The associated Vector.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Vector.

### getVector

    java.util.Vector getVector(java.lang.String key,
                               java.util.Vector defaultValue)

  Get a Vector of strings associated with the given configuration key.

  参数：
    `key` - The configuration key.
    `defaultValue` - The default value.
  返回：
    The associated Vector.
  抛出：
    `java.lang.ClassCastException` - is thrown if the key maps to an object that is not a Vector.

概述 | 软件包 | 类 | 使用 | 树 | 已过时 | 索引 | 帮助
上一个类 下一个类 | 框架 无框架
摘要： 嵌套 | 字段 | 构造函数 | 方法 | 详细信息： 字段 | 构造函数 | 方法