Class EvaluationContextFactories

java.lang.Object
pro.verron.officestamper.api.EvaluationContextFactories

@Deprecated(since="3.4", forRemoval=true) public class EvaluationContextFactories extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
A deprecated class providing factory methods for creating predefined EvaluationContextFactory instances. The factories are used to create EvaluationContext objects with specific configurations for evaluation logic. This class has been marked for removal in future versions and should no longer be used, it is planned to move this in the core package.
  • Method Details

    • restrictedFactory

      @Deprecated(since="3.4", forRemoval=true) public static EvaluationContextFactory restrictedFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.4, for removal in a future version. The use of this factory is no longer recommended due to upcoming changes in evaluation context configurations.

      Creates a restricted EvaluationContextFactory that provides a predefined, limited configuration to ensure security and control during expression evaluation. This factory configures the resulting EvaluationContext to disallow certain operations, such as bean resolution and type resolution, which could pose security risks.

      The resulting context supports access to properties and maps but restricts the use of reflection for method invocation and disables constructor resolution. The factory is particularly suited for scenarios where strict evaluation constraints are necessary to avoid potential misuse or unintended consequences.

      Returns:
      a restricted EvaluationContextFactory with controlled behavior and limited capabilities for evaluating expressions.
    • permissiveFactory

      @Deprecated(since="3.4", forRemoval=true) public static EvaluationContextFactory permissiveFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.4, for removal in a future version. The use of this factory is no longer recommended due to upcoming changes in evaluation context configurations.

      Creates a permissive EvaluationContextFactory that provides a configuration allowing flexible property and map access during evaluation.

      This factory configures the resulting EvaluationContext to include support for reflective property access and map-based property access. It incorporates an ordered list of PropertyAccessor implementations, granting enhanced capabilities for resolving properties and accessing data in expressions.

      The resulting context is designed for scenarios where relaxed evaluation constraints are needed to allow dynamic property and map access within the evaluation process. It may not be suitable for use in security-sensitive contexts due to its permissive nature.

      Returns:
      a permissive EvaluationContextFactory configured for flexible property and map access during evaluation.