public interface ITypeResolver<S,T>
A type resolver is responsible for mapping an object of a certain Java class to an object of the DOCX4J api that can be put into the .docx document. Type resolvers are used to replace placeholders within the .docx template.
Example: if an expression returns a Date object as result, this date object is passed to a DateResolver which creates a org.docx4j.wml.R object (run of text) containing the properly formatted date string.
To use your own type resolver, implement this interface and register your implementation by calling DocxStamper.getTypeResolverRegistry().addTypeResolver().
| Modifier and Type | Method and Description |
|---|---|
T |
resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document,
S expressionResult)
This method is called when a placeholder in the .docx template is to replaced by the result of an expression that
was found in the .docx template.
|
T resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, S expressionResult)
document - the word document that can be accessed via the DOCX4J api.expressionResult - the result of an expression. Only objects of classes this type resolver is registered for
within the TypeResolverRegistrey are passed into this method.Copyright © 2017. All rights reserved.