com.microfocus.awm.model.internal

## Class LinkedPropertyValue

- java.lang.Object
- - com.microfocus.awm.model.internal.PropertyValue
  - - com.microfocus.awm.model.internal.LinkedPropertyValue

- All Implemented Interfaces:
    IPropertyValue

      public class LinkedPropertyValue
      extends PropertyValue

  Copyright Micro Focus GmbH.

  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinkedPropertyValue(LinkedProperty pProp, EPropertyValueType pType, IExecutionContext pContext)` Tries to resolve a linked property resource identifier with the given context.
    `LinkedPropertyValue(LinkedProperty pProp, EPropertyValueType pType, java.lang.String pResourceIdentifier)` Constructor for a linked property value and a specific resource identifier.
    `LinkedPropertyValue(LinkedProperty pProperty, IExecutionContext pContext)` Basic constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCachedValue()` Gets the cached value from this linked property.
    `java.lang.String` | `getLabelOrValue()` Returns a label for a Property Value, if one was configured or set by a retrieval tool.
    `java.lang.String` | `getValue()` Gets the string value.
    `static java.lang.String` | `resolveResourceIdentifier(LinkedProperty pLinkedProperty, IExecutionContext pContext)` Searches a value for the given property in the execution context.
    `void` | `setLinkedValue(java.lang.String pValue)` Sets the "real" value of the linked property.
    `void` | `setValue(java.lang.String pValue)` Sets the cached value of this linked property.

    - ### Methods inherited from class com.microfocus.awm.model.internal.PropertyValue

      `addValue, getProperty, getType, getValues, isArray, setType, setValue, toString`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LinkedPropertyValue

          public LinkedPropertyValue(LinkedProperty pProperty,
                                     IExecutionContext pContext)

      Basic constructor. Calls `LinkedPropertyValue(LinkedProperty, EPropertyValueType, IExecutionContext)` .
      Parameters:
        `pProperty` - the linked property
        `pContext` - the execution context

    - #### LinkedPropertyValue

          public LinkedPropertyValue(LinkedProperty pProp,
                                     EPropertyValueType pType,
                                     java.lang.String pResourceIdentifier)

      Constructor for a linked property value and a specific resource identifier.
      Parameters:
        `pProp` - the linked property
        `pType` - the property type (can be `null`)
        `pResourceIdentifier` - the resource identifier

    - #### LinkedPropertyValue

          public LinkedPropertyValue(LinkedProperty pProp,
                                     EPropertyValueType pType,
                                     IExecutionContext pContext)

      Tries to resolve a linked property resource identifier with the given context.
      Parameters:
        `pProp` - the linked property
        `pType` - the property type. Must not be `null`
        `pContext` - the execution context

  - ### Method Detail

    - #### getValue

          public java.lang.String getValue()

      Description copied from interface: `IPropertyValue`
      Gets the string value. Does not support linked properties which require a resource identifier to resolve the value.

      If the property is of the type `ETypes.TEXT_ARRAY` this method returns the values of `IPropertyValue.getValues()` separated by the `Property.getStringDelimiterWithoutQuotes()` as string.

      Specified by:
        `getValue` in interface `IPropertyValue`
      Overrides:
        `getValue` in class `PropertyValue`
      Returns:
        the string value

    - #### setValue

          public void setValue(java.lang.String pValue)

      Sets the cached value of this linked property. This does not change the real value of the attribute this property is linked to.
      Specified by:
        `setValue` in interface `IPropertyValue`
      Overrides:
        `setValue` in class `PropertyValue`
      Parameters:
        `pValue` - the new cached value
      See Also:
        `getCachedValue()`, `setLinkedValue(String)`

    - #### setLinkedValue

          public void setLinkedValue(java.lang.String pValue)

      Sets the "real" value of the linked property.
      Parameters:
        `pValue` - the new value

    - #### getCachedValue

          public java.lang.String getCachedValue()

      Gets the cached value from this linked property.

      The cached value of a linked property value is a stored string which does not represent the actual resource value (returned by `getValue()` ). It can be used by tools e.g. to support UPDATE resource operations by setting the cached value without changing the resource the property is linked to.

      Returns:
        the cached value

    - #### resolveResourceIdentifier

          public static java.lang.String resolveResourceIdentifier(LinkedProperty pLinkedProperty,
                                                                   IExecutionContext pContext)

      Searches a value for the given property in the execution context. This is mainly used for `LinkedProperty`s which require a resource identifier.

      The search order is:

      1. Parameter memory
      2. Context map
      The default value of the property will not be considered.
      Parameters:
        `pLinkedProperty` - the linked property
        `pContext` - the execution context
      Returns:
        the resolved resource identifier or `null` if it can't be found in the context/memory.

    - #### getLabelOrValue

          public java.lang.String getLabelOrValue()

      Description copied from interface: `IPropertyValue`
      Returns a label for a Property Value, if one was configured or set by a retrieval tool.

      If there is no label for this value, the value will be returned.

      Specified by:
        `getLabelOrValue` in interface `IPropertyValue`
      Overrides:
        `getLabelOrValue` in class `PropertyValue`
      Returns:
        the label for this property or the value, if there is no label

Copyright © 2015 Micro Focus GmbH. All rights reserved.