Interface PackageTransformer


public interface PackageTransformer
Implementations can perform a variety of tasks such as transforming, filtering, enriching, etc. Inspired by dev.langchain4j.data.document.DocumentTransformer
Since:
11.5.1
  • Method Details

    • transform

      OpcPackage transform(OpcPackage srcPkg) throws Docx4JException
      Transforms the provided package. An implementation may alter the incoming srcPkg, so callers may wish to pass in a clone.
      Parameters:
      pkg - The package to be transformed.
      Returns:
      The transformed package, or null if the package should be filtered out.
      Throws:
      Docx4JException
    • transformAll

      default List<OpcPackage> transformAll(List<OpcPackage> pkgs) throws Docx4JException
      Transforms all the provided documents.
      Parameters:
      pkgs - A list of OpcPackage to be transformed.
      Returns:
      A list of transformed OpcPackage. The length of this list may be shorter or longer than the original list. Returns an empty list if all OpcPackage were filtered out.
      Throws:
      Docx4JException