Class BindingHandler

java.lang.Object
org.docx4j.model.datastorage.BindingHandler

public class BindingHandler extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • setHyperlinkStyle

      public static void setHyperlinkStyle(String hyperlinkStyleID)
      Deprecated.
      Configure, how the handler handles links found in Custom XML. If hyperlinkStyleId is set to null, strings containing 'http://' or 'https://' are not converted to w:hyperlink. This is the default behavior. If hyperlinkStyleId is set to "someWordHyperlinkStyleName", strings containing 'http://' or 'https://' or or 'mailto:' are converted to w:hyperlink. The default Word hyperlink style name is "Hyperlink". Due to the architecture of this class, this is a static flag changing the behavior of all following calls to applyBindings(org.docx4j.openpackaging.packages.WordprocessingMLPackage).
      Parameters:
      hyperlinkStyleID - The style to use for hyperlinks (eg Hyperlink)
    • getHyperlinkStyleId

      public static String getHyperlinkStyleId()
      Deprecated.
    • getHyperlinkResolver

      public static BindingHyperlinkResolver getHyperlinkResolver()
      Returns:
      the hyperlinkResolver
      Since:
      3.0.0
    • setHyperlinkResolver

      public static void setHyperlinkResolver(BindingHyperlinkResolver hyperlinkResolver)
      Parameters:
      hyperlinkResolver - the hyperlinkResolver to set
      Since:
      3.0.0
    • getValueInserterPlainText

      public static ValueInserterPlainText getValueInserterPlainText()
    • setValueInserterPlainText

      public static void setValueInserterPlainText(ValueInserterPlainText valueInserterPlainText)
      Allow user to customise what is inserted into the document when the bind is performed.
      Parameters:
      valueInserterPlainText -
      Since:
      6.0.1
    • setDomToXPathMap

      public void setDomToXPathMap(DomToXPathMap domToXPathMap)
    • setStartingIdForNewBookmarks

      public void setStartingIdForNewBookmarks(AtomicInteger bookmarkId)
      Provide a way to set the starting bookmark ID number for the purposes of Binding Traverse. For efficiency, user code needs to pass this value through from the previous stage (repeats/condition handing). If it isn't, the value will be calculated (less efficient). New bookmarks could be created from XHTML, or renumbered in Flat OPC XML (TODO).
      Parameters:
      bookmarkId -
      Since:
      3.2.1
    • initBookmarkIdStart

      protected AtomicInteger initBookmarkIdStart() throws Docx4JException
      Throws:
      Docx4JException
    • applyBindings

      @Deprecated public static void applyBindings(WordprocessingMLPackage wordMLPackage) throws Docx4JException
      Deprecated.
      Throws:
      Docx4JException
    • applyBindings

      public void applyBindings() throws Docx4JException
      Throws:
      Docx4JException
    • getXpathsMap

      public Map<String,Xpaths.Xpath> getXpathsMap()
    • applyBindings

      public void applyBindings(JaxbXmlPart part) throws Docx4JException
      Throws:
      Docx4JException
    • xpathGetString

      public static String xpathGetString(WordprocessingMLPackage pkg, Map<String,CustomXmlPart> customXmlDataStorageParts, CTDataBinding db)
    • xpathGetString

      public static String xpathGetString(WordprocessingMLPackage pkg, Map<String,CustomXmlPart> customXmlDataStorageParts, String storeItemId, String xpath, String prefixMappings)
      Used by OpenDoPE handler, but not directly by bind.xslt anymore. Not multiLine aware.
      Parameters:
      customXmlDataStorageParts -
      storeItemId -
      xpath -
      prefixMappings - a string such as "xmlns:ns0='http://schemas.medchart'"
      Returns: