Interface ObjectResolver

All Known Implementing Classes:
DateResolver, ImageResolver, LegacyFallbackResolver, LocalDateResolver, LocalDateTimeResolver, LocalTimeResolver, Null2DefaultResolver, Null2PlaceholderResolver, StringResolver, ToStringResolver, TypeResolver

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
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the given object can be resolved.
    org.docx4j.wml.R
    resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, String placeholder, Object object)
    Resolves the placeholder in the given document with the provided object.
  • Method Details

    • canResolve

      boolean canResolve(Object object)
      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
    • resolve

      org.docx4j.wml.R resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, String placeholder, Object object)
      Resolves the placeholder in the given document with the provided object.
      Parameters:
      document - the WordprocessingMLPackage document in which to resolve the placeholder
      placeholder - the placeholder value to be replaced
      object - the object to be used for resolving the placeholder
      Returns:
      the resolved value for the placeholder
      Throws:
      DocxStamperException - if no resolver is found for the object