Class Engine

java.lang.Object
pro.verron.officestamper.core.Engine

public class Engine extends Object
The core engine of OfficeStamper, responsible for processing expressions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Engine(org.springframework.expression.ExpressionParser expressionParser, ExceptionResolver exceptionResolver, ObjectResolverRegistry objectResolverRegistry, ProcessorContext processorContext)
    Constructs an Engine.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    process(org.springframework.expression.EvaluationContext evaluationContext)
    Processes the provided evaluation context against the expression defined in the processor context.
    resolve(org.springframework.expression.EvaluationContext evaluationContext)
    Resolves an Insert object by processing the provided evaluation context using the current processor context.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Engine

      public Engine(org.springframework.expression.ExpressionParser expressionParser, ExceptionResolver exceptionResolver, ObjectResolverRegistry objectResolverRegistry, ProcessorContext processorContext)
      Constructs an Engine.
      Parameters:
      expressionParser - the expression parser.
      exceptionResolver - the exception resolver.
      objectResolverRegistry - the object resolver registry.
      processorContext - the processor context.
  • Method Details

    • process

      public boolean process(org.springframework.expression.EvaluationContext evaluationContext)

      Processes the provided evaluation context against the expression defined in the processor context.

      The method attempts to resolve an expression using the given evaluation context.

      If successful, the process completes and logs a debug message.

      Otherwise, on failure (SpelEvaluationException or SpelParseException), it handles the exception by invoking the exceptionResolver and logs an error.

      Parameters:
      evaluationContext - the evaluation context for processing the expression.
      Returns:
      true if the processing was successful, otherwise false
    • resolve

      public Insert resolve(org.springframework.expression.EvaluationContext evaluationContext)
      Resolves an Insert object by processing the provided evaluation context using the current processor context. Combines the processor context's part and expression with various resolvers to achieve the resolution.
      Parameters:
      evaluationContext - the evaluation context for processing the expression.
      Returns:
      an Insert object representing the resolved result of the expression within the context.