org.apache.myfaces.trinidad.config

## Class PropertyValueProvider

- java.lang.Object
- - org.apache.myfaces.trinidad.config.PropertyValueProvider

- Direct Known Subclasses:
    TestPropertyValueProvider

      public abstract class PropertyValueProvider
      extends Object

  Abstract base class for configurable property value providers.

  A PropertyValueProvider can be registered by placing `/META-INF/services/org.apache.myfaces.trinidad.config.PropertyValueProvider` on the classpath containing the fully qualified name of the implementation class.

  Note: at this time the framework only supports one PropertyValueProvider being registered to avoid provider ordering issues.

  Implementation os this class are required to be thread safe allowing multiple threads to invoke methods on an instance concurrently.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PropertyValueProvider()` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract String` | `getValue(javax.faces.context.ExternalContext externalContext, String name)` Fetch a property value.
    `protected void` | `notifyValueChanged(javax.faces.context.ExternalContext externalContext, String name, String oldValue)` Implementations of this class are required to call this method when a property value is changed.

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

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

- - ### Constructor Detail

    - #### PropertyValueProvider

          protected PropertyValueProvider()

      Constructor.

  - ### Method Detail

    - #### getValue

          public abstract String getValue(javax.faces.context.ExternalContext externalContext,
                        String name)

      Fetch a property value. There is no concurrency control provided by the property service so all implementations of this method are required to be thread safe or to perform their own concurrency control.
      Parameters:
        `externalContext` - container context object.
        `name` - name of the requested property.
      Returns:
        the value of the property or `null` if the property was not found.
      Throws:
        `NullPointerException` - if the supplied property name is null.

    - #### notifyValueChanged

          protected final void notifyValueChanged(javax.faces.context.ExternalContext externalContext,
                                String name,
                                String oldValue)

      Implementations of this class are required to call this method when a property value is changed.
      Parameters:
        `externalContext` - container context object.
        `name` - the name of the property who's value changed.
        `oldValue` - the previous value of the property.
        `newValue` - the new value of the property.

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.