com.microfocus.awm.model

## Interface IPropertyProvider

-     public interface IPropertyProvider

  An implementation of `IPropertyProvider` is used to get or set property values. Property Providers can be registered by using the AWM model extension point `ModelExtensionParser.MODEL_EXTENSION_EXT_POINT_ID`.

  Property Providers are called frequently by AWM to check and update property values. It is important that the implementations of the `getPropertyValue(IExecutionContext, String, String)` and `setPropertyValue(IExecutionContext, String, String, String)` are very time efficient, since these methods can be called very often by AWM.

  If the reading of properties is time efficient, the `toolExecuted(IExecutionContext, ToolDescriptor, ToolExecutionStatus)` method can be called to update cached properties values only in specific situations.

  Copyright Micro Focus GmbH.

  Author:
    Ralf Pakosch

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canReadValue(IExecutionContext pContext, java.lang.String pResourceIdentifier, java.lang.String pPropertyID)` Called before getPropertyValue(…) is called to check whether the provider is able to get values for the specific property.
    `java.lang.String` | `getPropertyValue(IExecutionContext pContext, java.lang.String pResourceIdentifier, java.lang.String pPropertyID)` Returns a specific property value.
    `void` | `setPropertyValue(IExecutionContext pContext, java.lang.String pResourceIdentifier, java.lang.String pPropertyID, java.lang.String pNewValue)` Called by AWM when a property value should be set.
    `void` | `toolExecuted(IExecutionContext pContext, ToolDescriptor pTool, ToolExecutionStatus pToolResult)` Called after a tool has been executed.

- - ### Method Detail

    - #### toolExecuted

          void toolExecuted(IExecutionContext pContext,
                            ToolDescriptor pTool,
                            ToolExecutionStatus pToolResult)

      Called after a tool has been executed. Can be used to update cached property values after each executed tool. Allows updating cached values if caching is required due to performance reasons. Allowed to do nothing at all (return; only).

      For more informations about the tool execution process see `IToolExecutor.execTool(IExecutionContext, ToolDescriptor, String, org.eclipse.core.runtime.IProgressMonitor)`.

      Parameters:
        `pContext` - the execution context
        `pTool` - the descriptor of the tool that has been executed
        `pToolResult` - the result of the executed tool

    - #### getPropertyValue

          java.lang.String getPropertyValue(IExecutionContext pContext,
                                            java.lang.String pResourceIdentifier,
                                            java.lang.String pPropertyID)

      Returns a specific property value. It is important that the implementation is very time efficient, since this method can be called frequently by AWM.
      Parameters:
        `pContext` - the execution context. Can be `null`
        `pResourceIdentifier` - the resource identifier. Can be `null`
        `pPropertyID` - the ID of the property to set
      Returns:
        the resolved property value. Do not return `null`.

    - #### canReadValue

          boolean canReadValue(IExecutionContext pContext,
                               java.lang.String pResourceIdentifier,
                               java.lang.String pPropertyID)

      Called before getPropertyValue(…) is called to check whether the provider is able to get values for the specific property.
      Parameters:
        `pContext` - the execution context. Can be `null`
        `pResourceIdentifier` - the resource identifier. Can be `null`
        `pPropertyID` - the ID of the property to read
      Returns:
        whether the property value can be read

    - #### setPropertyValue

          void setPropertyValue(IExecutionContext pContext,
                                java.lang.String pResourceIdentifier,
                                java.lang.String pPropertyID,
                                java.lang.String pNewValue)

      Called by AWM when a property value should be set. It is important that the implementation is very time efficient, since this method can be called frequently by AWM.

      By default this method will only be called for properties, which have the `canSetValue` attribute set to `true` in their extension definition.

      Parameters:
        `pContext` - the execution context. Can be `null`
        `pResourceIdentifier` - the resource identifier. Can be `null`
        `pPropertyID` - the ID of the property to set
        `pNewValue` - the new value to set

Copyright © 2015 Micro Focus GmbH. All rights reserved.