Interface ObjectResolver
- All Known Implementing Classes:
StringResolver
public interface ObjectResolver
The ObjectResolver interface provides a contract for resolving objects to create a run
with the resolved content. It includes methods to check if an object can be resolved
and to actually resolve an object to a run.
- Since:
- 1.6.7
- Version:
- ${version}
- Author:
- Joseph Verron
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.Logger
A logger instance used for logging messages and events related to the operations performed within the ObjectResolver interface. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canResolve
(Object object) Checks if the given object can be resolved.default org.docx4j.wml.R
resolve
(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, String expression, Object object) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated and should not be called directly.default org.docx4j.wml.R
Resolves the expression in the given document with the provided object.default org.docx4j.wml.R
resolve
(DocxPart document, Placeholder placeholder, Object object) Resolves the expression in the given document with the provided object.
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGERA logger instance used for logging messages and events related to the operations performed within the ObjectResolver interface. This helps in tracking, debugging, and analyzing the execution of methods implemented by classes that use this interface.
-
-
Method Details
-
resolve
Resolves the expression in the given document with the provided object.- Parameters:
document
- theWordprocessingMLPackage
document in which to resolve the expressionplaceholder
- the expression value to be replacedobject
- the object to be used for resolving the expression- Returns:
- the resolved value for the expression
- Throws:
OfficeStamperException
- if no resolver is found for the object
-
resolve
Resolves the expression in the given document with the provided object.
Replace the previous
resolve(WordprocessingMLPackage, String, Object)
- Parameters:
docxPart
- theDocxPart
document in which to resolve the expressionexpression
- the expression value to be replacedobject
- the object to be used for resolving the expression- Returns:
- the resolved value for the expression
- Throws:
OfficeStamperException
- if no resolver is found for the object
-
resolve
@Deprecated(since="2.3", forRemoval=true) default org.docx4j.wml.R resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, String expression, Object object) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated and should not be called directly. It exists only for legacy implementations that might still override it.Resolves the expression in the given WordprocessingMLPackage document with the provided object.- Parameters:
document
- the WordprocessingMLPackage document in which to resolve the expressionexpression
- the expression value to be replacedobject
- the object to be used for resolving the expression- Returns:
- the resolved value for the expression
- Throws:
OfficeStamperException
- if this method is invoked directly
-
canResolve
Checks if the given object can be resolved.- Parameters:
object
- the object to be resolved- Returns:
- true if the object can be resolved, false otherwise
-