Interface RememberingPropertyExpressionResolver

All Superinterfaces:
PropertyExpressionResolver
All Known Implementing Classes:
RandomPropertyExpressionResolver

@Internal public interface RememberingPropertyExpressionResolver extends PropertyExpressionResolver
A PropertyExpressionResolver whose expressions resolve to another value every time, such as random.port, and that remembers what an expression of a property has resolved to.

When PropertySourcePropertyResolver resolves the placeholders of a property, it passes a memory for each expression it resolves: one for the expression at that place of the property's text. The property then keeps the value until the property resolver forgets it, as a refresh does. Where there is no property to remember the value for, the expression is resolved through PropertyExpressionResolver.resolve(PropertyResolver, ConversionService, String, Class), which draws a new value.

Since:
5.2.20
Author:
Radovan Radic
  • Method Details

    • resolve

      <T> Optional<T> resolve(PropertyResolver propertyResolver, ConversionService conversionService, String expression, Class<T> requiredType, RememberingPropertyExpressionResolver.Memory memory)
      Resolve the value for the expression of the specified type, keeping what the expression resolves to in the given memory.
      Type Parameters:
      T - The type
      Parameters:
      propertyResolver - The property resolver
      conversionService - The conversion service
      expression - The expression
      requiredType - The required type
      memory - The memory of the expression
      Returns:
      The optional resolved value