Module pro.verron.officestamper
Package pro.verron.officestamper.api
Interface OfficeStamperConfiguration
public interface OfficeStamperConfiguration
Interface representing the configuration for the Office Stamper functionality.
-
Method Summary
Modifier and TypeMethodDescriptionaddCommentProcessor
(Class<?> interfaceClass, Function<ParagraphPlaceholderReplacer, CommentProcessor> commentProcessorFactory) Adds a comment processor to the OfficeStamperConfiguration.addCustomFunction
(String name, Class<T> class0) <T,
U> CustomFunction.NeedsBiFunctionImpl <T, U> addCustomFunction
(String name, Class<T> class0, Class<U> class1) <T,
U, V> CustomFunction.NeedsTriFunctionImpl <T, U, V> addCustomFunction
(String name, Class<T> class0, Class<U> class1, Class<V> class2) void
addCustomFunction
(String name, Supplier<?> implementation) void
addPreprocessor
(PreProcessor preprocessor) Adds a pre-processor to the OfficeStamperConfiguration.addResolver
(ObjectResolver resolver) Adds an ObjectResolver to the OfficeStamperConfiguration.exposeInterfaceToExpressionLanguage
(Class<?> interfaceClass, Object implementation) Exposes an interface to the expression language.Returns a map of comment processors associated with their respective classes.Retrieves the EvaluationContextConfigurer for configuring the Spring Expression Language (SPEL) EvaluationContext used by the docxstamper.Retrieves the map of expression functions associated with their corresponding classes.Retrieves the line break placeholder used in the OfficeStamper configuration.Retrieves the list of pre-processors.Retrieves the list of ObjectResolvers.org.springframework.expression.spel.SpelParserConfiguration
Retrieves the SpelParserConfiguration used by the OfficeStamperConfiguration.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.boolean
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.boolean
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.boolean
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.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.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.setEvaluationContextConfigurer
(EvaluationContextConfigurer evaluationContextConfigurer) Sets the EvaluationContextConfigurer for configuring the Spring Expression Language (SPEL) EvaluationContext.setExceptionResolver
(ExceptionResolver exceptionResolver) 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.setLineBreakPlaceholder
(String lineBreakPlaceholder) Sets the line break placeholder used in the OfficeStamper configuration.setResolvers
(List<ObjectResolver> resolvers) Sets the list of object resolvers for the OfficeStamper configuration.setSpelParserConfiguration
(org.springframework.expression.spel.SpelParserConfiguration spelParserConfiguration) Sets the SpelParserConfiguration used by the 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.
-
Method Details
-
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 bysetExceptionResolver(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 bysetExceptionResolver(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, 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 bysetExceptionResolver(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, 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 bysetExceptionResolver(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, 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 bysetExceptionResolver(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 bysetExceptionResolver(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 bysetExceptionResolver(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 bysetExceptionResolver(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 exposedimplementation
- 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 processorcommentProcessorFactory
- a function that creates a CommentProcessor object based on the ParagraphPlaceholderReplacer implementation- Returns:
- the updated OfficeStamperConfiguration object
-
addPreprocessor
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
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
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<?>,Function<ParagraphPlaceholderReplacer, getCommentProcessors()CommentProcessor>> 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
-
customFunctions
List<CustomFunction> customFunctions() -
addCustomFunction
-
addCustomFunction
-
addCustomFunction
<T,U> CustomFunction.NeedsBiFunctionImpl<T,U> addCustomFunction(String name, Class<T> class0, Class<U> class1) -
addCustomFunction
<T,U, CustomFunction.NeedsTriFunctionImpl<T,V> U, addCustomFunctionV> (String name, Class<T> class0, Class<U> class1, Class<V> class2)
-