Class DocumentUtil

java.lang.Object
pro.verron.officestamper.core.DocumentUtil

public class DocumentUtil extends Object
Utility class to retrieve elements from a document.
Since:
1.4.7
Version:
${version}
Author:
Joseph Verron, DallanMC
  • Method Details

    • findSmallestCommonParent

      public static org.docx4j.wml.ContentAccessor findSmallestCommonParent(Object o1, Object o2)
      Finds the smallest common parent between two objects.
      Parameters:
      o1 - the first object
      o2 - the second object
      Returns:
      the smallest common parent of the two objects
      Throws:
      OfficeStamperException - if there is an error finding the common parent
    • depthElementSearch

      public static boolean depthElementSearch(Object searchTarget, Object searchTree)
      Recursively searches for an element in a content tree.
      Parameters:
      searchTarget - the element to search for
      searchTree - the content tree to search in
      Returns:
      true if the element is found, false otherwise