Interface OfficeStamperConfiguration

All Known Implementing Classes:
DocxStamperConfiguration

public interface OfficeStamperConfiguration
Interface representing the configuration for the Office Stamper functionality.
  • Method Details

    • exposeInterfaceToExpressionLanguage

      OfficeStamperConfiguration exposeInterfaceToExpressionLanguage(Class<?> interfaceClass, Object implementation)
      Exposes an interface to the expression language.
      Parameters:
      interfaceClass - the interface class to be exposed
      implementation - the implementation object of the interface
      Returns:
      the updated OfficeStamperConfiguration object
    • addCommentProcessor

      OfficeStamperConfiguration addCommentProcessor(Class<?> interfaceClass, CommentProcessorFactory commentProcessorFactory)

      Adds a comment processor to the OfficeStamperConfiguration.

      A comment processor is responsible for processing comments in the document and performing specific operations based on the comment content.

      Parameters:
      interfaceClass - the interface class associated with the comment processor
      commentProcessorFactory - a factory that creates a CommentProcessor object
      Returns:
      the updated OfficeStamperConfiguration object
    • addPreprocessor

      void addPreprocessor(PreProcessor preprocessor)

      Adds a pre-processor to the OfficeStamperConfiguration.

      A pre-processor is responsible for processing the document before the actual processing takes place.

      Parameters:
      preprocessor - the pre-processor to add
    • getEvaluationContextFactory

      EvaluationContextFactory getEvaluationContextFactory()
      Retrieves the EvaluationContextFactory for creating Spring Expression Language (SpEL) EvaluationContext instances used by the office stamper.
      Returns:
      the EvaluationContextFactory for creating SpEL EvaluationContext instances.
    • setEvaluationContextFactory

      OfficeStamperConfiguration setEvaluationContextFactory(EvaluationContextFactory evaluationContextFactory)
      Sets the EvaluationContextFactory for creating Spring Expression Language (SpEL) EvaluationContext instances.
      Parameters:
      evaluationContextFactory - the EvaluationContextFactory for creating SpEL EvaluationContext instances.
      Returns:
      the updated OfficeStamperConfiguration object.
    • getExpressionFunctions

      Map<Class<?>,Object> getExpressionFunctions()
      Retrieves the map of expression functions associated with their corresponding classes.
      Returns:
      a map containing the expression functions as values and their corresponding classes as keys.
    • getCommentProcessors

      Map<Class<?>, CommentProcessorFactory> getCommentProcessors()
      Returns a map of comment processors associated with their respective classes.
      Returns:
      The map of comment processors. The keys are the classes, and the values are the corresponding comment processor factories.
    • getPreprocessors

      List<PreProcessor> getPreprocessors()
      Retrieves the list of pre-processors.
      Returns:
      The list of pre-processors.
    • getResolvers

      List<ObjectResolver> getResolvers()
      Retrieves the list of ObjectResolvers.
      Returns:
      The list of ObjectResolvers.
    • setResolvers

      Sets the list of object resolvers for the OfficeStamper configuration.
      Parameters:
      resolvers - the list of object resolvers to be set
      Returns:
      the updated OfficeStamperConfiguration instance
    • addResolver

      Adds an ObjectResolver to the OfficeStamperConfiguration.
      Parameters:
      resolver - The ObjectResolver to add to the configuration.
      Returns:
      The updated OfficeStamperConfiguration.
    • getExceptionResolver

      ExceptionResolver getExceptionResolver()
      Retrieves the instance of the ExceptionResolver.
      Returns:
      the ExceptionResolver instance used to handle exceptions
    • setExceptionResolver

      OfficeStamperConfiguration setExceptionResolver(ExceptionResolver exceptionResolver)
      Sets the exception resolver to be used by the OfficeStamperConfiguration. The exception resolver determines how exceptions will be handled during the processing of office documents.
      Parameters:
      exceptionResolver - the ExceptionResolver instance to set
      Returns:
      the current instance of OfficeStamperConfiguration for method chaining
    • customFunctions

      List<CustomFunction> customFunctions()
      Retrieves a list of custom functions.
      Returns:
      a List containing instances of CustomFunction.
    • addCustomFunction

      void addCustomFunction(String name, Supplier<?> implementation)
      Adds a custom function to the system with the specified name and implementation.
      Parameters:
      name - the unique name of the custom function to be added
      implementation - a Supplier that provides the implementation of the custom function
    • addCustomFunction

      <T> CustomFunction.NeedsFunctionImpl<T> addCustomFunction(String name, Class<T> class0)
      Adds a custom function with the specified name and associated class type. This method allows users to define custom behavior by associating a function implementation with a given name and type.
      Type Parameters:
      T - The type associated with the custom function.
      Parameters:
      name - The name of the custom function to be added.
      class0 - The class type of the custom function.
      Returns:
      An instance of NeedsFunctionImpl parameterized with the type of the custom function.
    • addCustomFunction

      <T,U> CustomFunction.NeedsBiFunctionImpl<T,U> addCustomFunction(String name, Class<T> class0, Class<U> class1)
      Adds a custom bi-function with the specified name and the provided parameter types.
      Type Parameters:
      T - the type of the first parameter
      U - the type of the second parameter
      Parameters:
      name - the name of the custom function to be added
      class0 - the class type for the first parameter of the bi-function
      class1 - the class type for the second parameter of the bi-function
      Returns:
      an instance of NeedsBiFunctionImpl parameterized with the provided types
    • addCustomFunction

      <T,U,V> CustomFunction.NeedsTriFunctionImpl<T,U,V> addCustomFunction(String name, Class<T> class0, Class<U> class1, Class<V> class2)
      Adds a custom function with the specified parameters.
      Type Parameters:
      T - the type of the first parameter
      U - the type of the second parameter
      V - the type of the third parameter
      Parameters:
      name - the name of the custom function
      class0 - the class type of the first parameter
      class1 - the class type of the second parameter
      class2 - the class type of the third parameter
      Returns:
      an instance of NeedsTriFunctionImpl for the provided parameter types
    • getPostprocessors

      List<PostProcessor> getPostprocessors()
      Retrieves the list of post-processors associated with this instance.
      Returns:
      a list of PostProcessor objects.
    • addPostprocessor

      void addPostprocessor(PostProcessor postProcessor)
      Adds a postprocessor to modify or enhance data or operations during the processing lifecycle.
      Parameters:
      postProcessor - the PostProcessor instance to be added
    • getExpressionParser

      org.springframework.expression.ExpressionParser getExpressionParser()
      Retrieves the expression parser used by the office stamper.
      Returns:
      the ExpressionParser instance.
    • setExpressionParser

      OfficeStamperConfiguration setExpressionParser(org.springframework.expression.ExpressionParser expressionParser)
      Sets the expression parser to be used by the office stamper.
      Parameters:
      expressionParser - the ExpressionParser instance to set.
      Returns:
      the updated OfficeStamperConfiguration object.