public class DocxStamperConfiguration
extends java.lang.Object
| Constructor and Description |
|---|
DocxStamperConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
DocxStamperConfiguration |
addCommentProcessor(java.lang.Class<?> interfaceClass,
ICommentProcessor commentProcessor)
Registers the specified ICommentProcessor as an implementation of the
specified interface.
|
<T> DocxStamperConfiguration |
addTypeResolver(java.lang.Class<T> resolvedType,
ITypeResolver resolver)
Registers the given ITypeResolver for the given class.
|
DocxStamper |
build()
Creates a
DocxStamper instance configured with this configuration. |
DocxStamperConfiguration |
exposeInterfaceToExpressionLanguage(java.lang.Class<?> interfaceClass,
java.lang.Object implementation)
Exposes all methods of a given interface to the expression language.
|
java.util.Map<java.lang.Class<?>,java.lang.Object> |
getExpressionFunctions() |
DocxStamperConfiguration |
setDefaultTypeResolver(ITypeResolver defaultTypeResolver) |
DocxStamperConfiguration |
setEvaluationContextConfigurer(EvaluationContextConfigurer evaluationContextConfigurer)
Provides an
EvaluationContextConfigurer which may change the configuration of a Spring
EvaluationContext which is used for evaluating expressions
in comments and text. |
DocxStamperConfiguration |
setFailOnUnresolvedExpression(boolean failOnUnresolvedExpression)
If set to true, stamper will throw an
UnresolvedExpressionException
if a variable expression or processor expression within the document or within the comments is encountered that cannot be resolved. |
DocxStamperConfiguration |
setLineBreakPlaceholder(java.lang.String lineBreakPlaceholder)
The String provided as lineBreakPlaceholder will be replaces with a line break
when stamping a document.
|
public DocxStamperConfiguration setLineBreakPlaceholder(java.lang.String lineBreakPlaceholder)
lineBreakPlaceholder - the String that should be replaced with line breaks during stamping.public DocxStamperConfiguration setEvaluationContextConfigurer(EvaluationContextConfigurer evaluationContextConfigurer)
EvaluationContextConfigurer which may change the configuration of a Spring
EvaluationContext which is used for evaluating expressions
in comments and text.evaluationContextConfigurer - the configurer to use.public DocxStamperConfiguration setFailOnUnresolvedExpression(boolean failOnUnresolvedExpression)
UnresolvedExpressionException
if a variable expression or processor expression within the document or within the comments is encountered that cannot be resolved. Is set to true by default.public DocxStamperConfiguration addCommentProcessor(java.lang.Class<?> interfaceClass, ICommentProcessor commentProcessor)
interfaceClass - the Interface which is implemented by the commentProcessor.commentProcessor - the commentProcessor implementing the specified interface.public <T> DocxStamperConfiguration addTypeResolver(java.lang.Class<T> resolvedType, ITypeResolver resolver)
Registers the given ITypeResolver for the given class. The registered ITypeResolver's resolve() method will only be called with objects of the specified class.
Note that each type can only be resolved by ONE ITypeResolver implementation. Multiple calls to addTypeResolver() with the same resolvedType parameter will override earlier calls.
T - the type resolved by the ITypeResolver.resolvedType - the class whose objects are to be passed to the given ITypeResolver.resolver - the resolver to resolve objects of the given type.public DocxStamperConfiguration exposeInterfaceToExpressionLanguage(java.lang.Class<?> interfaceClass, java.lang.Object implementation)
interfaceClass - the interface whose methods should be exposed in the expression language.implementation - the implementation that should be called to evaluate invocations of the interface methods
within the expression language. Must implement the interface above.public DocxStamper build()
DocxStamper instance configured with this configuration.public DocxStamperConfiguration setDefaultTypeResolver(ITypeResolver defaultTypeResolver)
public java.util.Map<java.lang.Class<?>,java.lang.Object> getExpressionFunctions()
Copyright © 2017. All rights reserved.