java.lang.Object
org.wickedsource.docxstamper.replace.typeresolver.image.ImageResolver
All Implemented Interfaces:
ITypeResolver<Image>

public class ImageResolver extends Object implements ITypeResolver<Image>
This ITypeResolver allows context objects to return objects of type Image. An expression that resolves to an Image object will be replaced by an actual image in the resulting .docx document. The image will be put as an inline into the surrounding paragraph of text.
Version:
1.6.6
Author:
Joseph Verron
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.docx4j.wml.R
    createRunWithImage(Integer maxWidth, org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage abstractImage)
    Creates a run containing the given image.
    org.docx4j.wml.R
    resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, Image image)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ImageResolver

      public ImageResolver()
  • Method Details

    • createRunWithImage

      public static org.docx4j.wml.R createRunWithImage(Integer maxWidth, org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage abstractImage)
      Creates a run containing the given image.
      Parameters:
      maxWidth - max width of the image
      abstractImage - the image
      Returns:
      the run containing the image
    • resolve

      public org.docx4j.wml.R resolve(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, Image image)
      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. It creates an object of the DOCX4J api that is put in the place of the found expression.
      Specified by:
      resolve in interface ITypeResolver<Image>
      Parameters:
      document - the word document that can be accessed via the DOCX4J api.
      image - the result of an expression. Only objects of classes this type resolver is registered for within the TypeResolverRegistrey are passed into this method.
      Returns:
      an object of the DOCX4J api (usually of type org.docx4j.wml.R = "run of text") that will be put in the place of an expression found in the .docx document.