Class EvaluationContextConfigurers

java.lang.Object
pro.verron.officestamper.preset.EvaluationContextConfigurers

public class EvaluationContextConfigurers extends Object
Utility class for configuring the EvaluationContext used by officestamper.
  • Method Details

    • noopConfigurer

      public static EvaluationContextConfigurer noopConfigurer()
      Returns a EvaluationContextConfigurer instance that does no customization.

      This configurer does nothing to the StandardEvaluationContext class, and therefore all the unfiltered features are accessible. It should be used when there is a need to use the powerful features of the aforementioned class, and there is a trust that the template won't contain any dangerous injections.

      Returns:
      a EvaluationContextConfigurer instance
    • defaultConfigurer

      public static EvaluationContextConfigurer defaultConfigurer()
      Returns a default EvaluationContextConfigurer instance.

      The default configurer provides better default security for the EvaluationContext used by OfficeStamper. It sets up the context with enhanced security measures, such as limited property accessors, constructor resolvers, and method resolvers. It also sets a type locator, type converter, type comparator, and operator overloader. This configurer is recommended to be used when there is a need for improved security and protection against potential dangerous injections in the template.

      Returns:
      a EvaluationContextConfigurer instance with enhanced security features