Interface OfficeStamperConfiguration


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

    • isFailOnUnresolvedExpression

      @Deprecated(since="2.5", forRemoval=true) boolean isFailOnUnresolvedExpression()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Checks if the failOnUnresolvedExpression flag is set to true or false.
      Returns:
      true if failOnUnresolvedExpression is set to true, false otherwise.
    • setFailOnUnresolvedExpression

      @Deprecated(since="2.5", forRemoval=true) OfficeStamperConfiguration setFailOnUnresolvedExpression(boolean failOnUnresolvedExpression)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Sets the failOnUnresolvedExpression flag to determine whether unresolved expressions should cause an exception to be thrown.
      Parameters:
      failOnUnresolvedExpression - flag indicating whether to fail on unresolved expressions
      Returns:
      the updated OfficeStamperConfiguration object
    • isLeaveEmptyOnExpressionError

      @Deprecated(since="2.5", forRemoval=true) boolean isLeaveEmptyOnExpressionError()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Determines whether to leave empty on expression error.
      Returns:
      true if expression errors are left empty, false otherwise
    • isReplaceUnresolvedExpressions

      @Deprecated(since="2.5", forRemoval=true) boolean isReplaceUnresolvedExpressions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Determines whether unresolved expressions in the OfficeStamper configuration should be replaced.
      Returns:
      true if unresolved expressions should be replaced, false otherwise.
    • getUnresolvedExpressionsDefaultValue

      @Deprecated(since="2.5", forRemoval=true) String getUnresolvedExpressionsDefaultValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Retrieves the default value for unresolved expressions.
      Returns:
      the default value for unresolved expressions
    • unresolvedExpressionsDefaultValue

      @Deprecated(since="2.5", forRemoval=true) OfficeStamperConfiguration unresolvedExpressionsDefaultValue(String unresolvedExpressionsDefaultValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Sets the default value for unresolved expressions in the OfficeStamperConfiguration object.
      Parameters:
      unresolvedExpressionsDefaultValue - the default value for unresolved expressions
      Returns:
      the updated OfficeStamperConfiguration object
    • replaceUnresolvedExpressions

      @Deprecated(since="2.5", forRemoval=true) OfficeStamperConfiguration replaceUnresolvedExpressions(boolean replaceUnresolvedExpressions)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Replaces unresolved expressions in the OfficeStamperConfiguration object.
      Parameters:
      replaceUnresolvedExpressions - flag indicating whether to replace unresolved expressions
      Returns:
      the updated OfficeStamperConfiguration object
    • leaveEmptyOnExpressionError

      @Deprecated(since="2.5", forRemoval=true) OfficeStamperConfiguration leaveEmptyOnExpressionError(boolean leaveEmpty)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is deprecated because it offers limited functionality by just checking a flag. It is replaced by setExceptionResolver(ExceptionResolver) , which provides complete customization over the behavior during resolution failures. The new method allows you to define how unresolved expressions are handled in a more flexible and comprehensive manner.
      Configures whether to leave empty on expression error.
      Parameters:
      leaveEmpty - boolean value indicating whether to leave empty on expression error
      Returns:
      the updated OfficeStamperConfiguration object
    • 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, Function<ParagraphPlaceholderReplacer,CommentProcessor> 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 function that creates a CommentProcessor object based on the ParagraphPlaceholderReplacer implementation
      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
    • getLineBreakPlaceholder

      String getLineBreakPlaceholder()
      Retrieves the line break placeholder used in the OfficeStamper configuration.
      Returns:
      the line break placeholder as a String.
    • setLineBreakPlaceholder

      OfficeStamperConfiguration setLineBreakPlaceholder(String lineBreakPlaceholder)
      Sets the line break placeholder used in the OfficeStamper configuration.
      Parameters:
      lineBreakPlaceholder - the line break placeholder as a String
      Returns:
      the updated OfficeStamperConfiguration object
    • getEvaluationContextConfigurer

      EvaluationContextConfigurer getEvaluationContextConfigurer()
      Retrieves the EvaluationContextConfigurer for configuring the Spring Expression Language (SPEL) EvaluationContext used by the docxstamper.
      Returns:
      the EvaluationContextConfigurer for configuring the SPEL EvaluationContext.
    • setEvaluationContextConfigurer

      OfficeStamperConfiguration setEvaluationContextConfigurer(EvaluationContextConfigurer evaluationContextConfigurer)
      Sets the EvaluationContextConfigurer for configuring the Spring Expression Language (SPEL) EvaluationContext.
      Parameters:
      evaluationContextConfigurer - the EvaluationContextConfigurer for configuring the SPEL EvaluationContext. Must implement the evaluateEvaluationContext() method.
      Returns:
      the updated OfficeStamperConfiguration object.
    • getSpelParserConfiguration

      org.springframework.expression.spel.SpelParserConfiguration getSpelParserConfiguration()
      Retrieves the SpelParserConfiguration used by the OfficeStamperConfiguration.
      Returns:
      the SpelParserConfiguration object used by the OfficeStamperConfiguration.
    • setSpelParserConfiguration

      OfficeStamperConfiguration setSpelParserConfiguration(org.springframework.expression.spel.SpelParserConfiguration spelParserConfiguration)
      Sets the SpelParserConfiguration used by the OfficeStamperConfiguration.
      Parameters:
      spelParserConfiguration - the SpelParserConfiguration to be set
      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

      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 processors.
    • 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()
    • setExceptionResolver

      OfficeStamperConfiguration setExceptionResolver(ExceptionResolver exceptionResolver)