Class Engine
java.lang.Object
pro.verron.officestamper.core.Engine
The core engine of OfficeStamper, responsible for processing expressions.
-
Constructor Summary
ConstructorsConstructorDescriptionEngine(org.springframework.expression.ExpressionParser expressionParser, ExceptionResolver exceptionResolver, ObjectResolverRegistry objectResolverRegistry, ProcessorContext processorContext) Constructs an Engine. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprocess(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 anInsertobject by processing the provided evaluation context using the current processor context.
-
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 (
SpelEvaluationExceptionorSpelParseException), 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
Resolves anInsertobject 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
Insertobject representing the resolved result of the expression within the context.
-