Interface OfficeStamperConfiguration
- All Known Implementing Classes:
DocxStamperConfiguration
public interface OfficeStamperConfiguration
Interface representing the configuration for the Office Stamper functionality.
-
Method Summary
Modifier and TypeMethodDescriptionaddCommentProcessor(Class<?> interfaceClass, CommentProcessorFactory commentProcessorFactory) Adds a comment processor to theOfficeStamperConfiguration.addCustomFunction(String name, Class<T> class0) Adds a custom function with the specified name and associated class type.<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.<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.voidaddCustomFunction(String name, Supplier<?> implementation) Adds a custom function to the system with the specified name and implementation.voidaddPostprocessor(PostProcessor postProcessor) Adds a postprocessor to modify or enhance data or operations during the processing lifecycle.voidaddPreprocessor(PreProcessor preprocessor) Adds a pre-processor to theOfficeStamperConfiguration.addResolver(ObjectResolver resolver) Adds an ObjectResolver to the OfficeStamperConfiguration.Retrieves a list of custom functions.exposeInterfaceToExpressionLanguage(Class<?> interfaceClass, Object implementation) Exposes an interface to the expression language.Returns a map of comment processors associated with their respective classes.Retrieves theEvaluationContextFactoryfor creating Spring Expression Language (SpEL)EvaluationContextinstances used by the office stamper.Retrieves the instance of the ExceptionResolver.Retrieves the map of expression functions associated with their corresponding classes.org.springframework.expression.ExpressionParserRetrieves the expression parser used by the office stamper.Retrieves the list of post-processors associated with this instance.Retrieves the list of pre-processors.Retrieves the list of ObjectResolvers.setEvaluationContextFactory(EvaluationContextFactory evaluationContextFactory) Sets theEvaluationContextFactoryfor creating Spring Expression Language (SpEL) EvaluationContext instances.setExceptionResolver(ExceptionResolver exceptionResolver) Sets the exception resolver to be used by the OfficeStamperConfiguration.setExpressionParser(org.springframework.expression.ExpressionParser expressionParser) Sets the expression parser to be used by the office stamper.setResolvers(List<ObjectResolver> resolvers) Sets the list of object resolvers for the OfficeStamper configuration.
-
Method Details
-
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
OfficeStamperConfigurationobject
-
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 processorcommentProcessorFactory- a factory that creates aCommentProcessorobject- Returns:
- the updated
OfficeStamperConfigurationobject
-
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
-
getEvaluationContextFactory
EvaluationContextFactory getEvaluationContextFactory()Retrieves theEvaluationContextFactoryfor creating Spring Expression Language (SpEL)EvaluationContextinstances used by the office stamper.- Returns:
- the
EvaluationContextFactoryfor creating SpEL EvaluationContext instances.
-
setEvaluationContextFactory
OfficeStamperConfiguration setEvaluationContextFactory(EvaluationContextFactory evaluationContextFactory) Sets theEvaluationContextFactoryfor creating Spring Expression Language (SpEL) EvaluationContext instances.- Parameters:
evaluationContextFactory- theEvaluationContextFactoryfor creating SpELEvaluationContextinstances.- Returns:
- the updated
OfficeStamperConfigurationobject.
-
getExpressionFunctions
-
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
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
-
addCustomFunction
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 parameterU- the type of the second parameter- Parameters:
name- the name of the custom function to be addedclass0- the class type for the first parameter of the bi-functionclass1- the class type for the second parameter of the bi-function- Returns:
- an instance of NeedsBiFunctionImpl parameterized with the provided types
-
addCustomFunction
<T,U, CustomFunction.NeedsTriFunctionImpl<T,V> U, addCustomFunctionV> (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 parameterU- the type of the second parameterV- the type of the third parameter- Parameters:
name- the name of the custom functionclass0- the class type of the first parameterclass1- the class type of the second parameterclass2- 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
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
ExpressionParserinstance.
-
setExpressionParser
OfficeStamperConfiguration setExpressionParser(org.springframework.expression.ExpressionParser expressionParser) Sets the expression parser to be used by the office stamper.- Parameters:
expressionParser- theExpressionParserinstance to set.- Returns:
- the updated
OfficeStamperConfigurationobject.
-