org.apache.tamaya.mutableconfig.propertysources

## Class MutablePropertiesPropertySource

- java.lang.Object
- - org.apache.tamaya.spisupport.BasePropertySource
  - - org.apache.tamaya.mutableconfig.propertysources.AbstractMutablePropertySource
    - - org.apache.tamaya.mutableconfig.propertysources.MutablePropertiesPropertySource

- All Implemented Interfaces:
    MutablePropertySource, org.apache.tamaya.spi.PropertySource

      public class MutablePropertiesPropertySource
      extends AbstractMutablePropertySource

  Simple implementation of a mutable `PropertySource` for .properties files.

- - ### Field Summary

    - ### Fields inherited from class org.apache.tamaya.mutableconfig.propertysources.AbstractMutablePropertySource

      `transactions`

    - ### Fields inherited from interface org.apache.tamaya.spi.PropertySource

      `EMPTY, TAMAYA_ORDINAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutablePropertiesPropertySource(File propertiesLocation, int defaultOrdinal)` Creates a new Properties based PropertySource based on the given URL.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `commitInternal(ConfigChangeContext context)` Commit of the changes to the current property source.
    `org.apache.tamaya.spi.PropertyValue` | `get(String key)`
    `String` | `getName()`
    `Map<String,String>` | `getProperties()`

    - ### Methods inherited from class org.apache.tamaya.mutableconfig.propertysources.AbstractMutablePropertySource

      `commitTransaction, getAddedProperties, getRemovedProperties, isRemovable, isWritable, put, putAll, remove, remove, rollbackTransaction, startTransaction`

    - ### Methods inherited from class org.apache.tamaya.spisupport.BasePropertySource

      `getDefaultOrdinal, getOrdinal, isScannable`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.tamaya.spi.PropertySource

      `getOrdinal, isScannable`

- - ### Constructor Detail

    - #### MutablePropertiesPropertySource

          public MutablePropertiesPropertySource(File propertiesLocation,
                                         int defaultOrdinal)

      Creates a new Properties based PropertySource based on the given URL.
      Parameters:
        `propertiesLocation` - the URL encoded location, not null.
        `defaultOrdinal` - the default ordinal to be used, when no ordinal is provided with the property source's properties.

  - ### Method Detail

    - #### get

          public org.apache.tamaya.spi.PropertyValue get(String key)

      Specified by:
        `get` in interface `org.apache.tamaya.spi.PropertySource`
      Overrides:
        `get` in class `org.apache.tamaya.spisupport.BasePropertySource`

    - #### getName

          public String getName()

    - #### getProperties

          public Map<String,String> getProperties()

    - #### commitInternal

          protected void commitInternal(ConfigChangeContext context)

      Description copied from class: `AbstractMutablePropertySource`
      Commit of the changes to the current property source. This is the last chance to get changes written back to the property source. On return the transactional context will be removed.
      Specified by:
        `commitInternal` in class `AbstractMutablePropertySource`
      Parameters:
        `context` - The configuration change to be committed/applied.

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.