Package org.docx4j.model.datastorage
Class BindingHandler
java.lang.Object
org.docx4j.model.datastorage.BindingHandler
public class BindingHandler
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CORE_PROPERTIES_STOREITEMID
static java.lang.String
COVERPAGE_PROPERTIES_STOREITEMID
static java.lang.String
EXTENDED_PROPERTIES_STOREITEMID
-
Constructor Summary
Constructors Constructor Description BindingHandler(WordprocessingMLPackage wordMLPackage)
-
Method Summary
Modifier and Type Method Description void
applyBindings()
static void
applyBindings(WordprocessingMLPackage wordMLPackage)
Deprecated.void
applyBindings(JaxbXmlPart part)
static BindingHyperlinkResolver
getHyperlinkResolver()
static java.lang.String
getHyperlinkStyleId()
Deprecated.static ValueInserterPlainText
getValueInserterPlainText()
java.util.Map<java.lang.String,Xpaths.Xpath>
getXpathsMap()
protected java.util.concurrent.atomic.AtomicInteger
initBookmarkIdStart()
void
setDomToXPathMap(DomToXPathMap domToXPathMap)
static void
setHyperlinkResolver(BindingHyperlinkResolver hyperlinkResolver)
static void
setHyperlinkStyle(java.lang.String hyperlinkStyleID)
Deprecated.void
setStartingIdForNewBookmarks(java.util.concurrent.atomic.AtomicInteger bookmarkId)
Provide a way to set the starting bookmark ID number for the purposes of Binding Traverse.static void
setValueInserterPlainText(ValueInserterPlainText valueInserterPlainText)
Allow user to customise what is inserted into the document when the bind is performed.static java.lang.String
xpathGetString(WordprocessingMLPackage pkg, java.util.Map<java.lang.String,CustomXmlPart> customXmlDataStorageParts, java.lang.String storeItemId, java.lang.String xpath, java.lang.String prefixMappings)
Used by OpenDoPE handler, but not directly by bind.xslt anymore.static java.lang.String
xpathGetString(WordprocessingMLPackage pkg, java.util.Map<java.lang.String,CustomXmlPart> customXmlDataStorageParts, CTDataBinding db)
-
Field Details
-
CORE_PROPERTIES_STOREITEMID
public static final java.lang.String CORE_PROPERTIES_STOREITEMID- See Also:
- Constant Field Values
-
EXTENDED_PROPERTIES_STOREITEMID
public static final java.lang.String EXTENDED_PROPERTIES_STOREITEMID- See Also:
- Constant Field Values
-
COVERPAGE_PROPERTIES_STOREITEMID
public static final java.lang.String COVERPAGE_PROPERTIES_STOREITEMID- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
setHyperlinkStyle
public static void setHyperlinkStyle(java.lang.String hyperlinkStyleID)Deprecated.Configure, how the handler handles links found in Custom XML. If hyperlinkStyleId is set tonull
, 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 toapplyBindings(org.docx4j.openpackaging.packages.WordprocessingMLPackage)
.- Parameters:
hyperlinkStyleID
- The style to use for hyperlinks (eg Hyperlink)
-
getHyperlinkStyleId
public static java.lang.String getHyperlinkStyleId()Deprecated. -
getHyperlinkResolver
- Returns:
- the hyperlinkResolver
- Since:
- 3.0.0
-
setHyperlinkResolver
- Parameters:
hyperlinkResolver
- the hyperlinkResolver to set- Since:
- 3.0.0
-
getValueInserterPlainText
-
setValueInserterPlainText
Allow user to customise what is inserted into the document when the bind is performed.- Parameters:
valueInserterPlainText
-- Since:
- 6.0.1
-
setDomToXPathMap
-
setStartingIdForNewBookmarks
public void setStartingIdForNewBookmarks(java.util.concurrent.atomic.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 java.util.concurrent.atomic.AtomicInteger initBookmarkIdStart() -
applyBindings
@Deprecated public static void applyBindings(WordprocessingMLPackage wordMLPackage) throws Docx4JExceptionDeprecated.- Throws:
Docx4JException
-
applyBindings
- Throws:
Docx4JException
-
getXpathsMap
-
applyBindings
- Throws:
Docx4JException
-
xpathGetString
public static java.lang.String xpathGetString(WordprocessingMLPackage pkg, java.util.Map<java.lang.String,CustomXmlPart> customXmlDataStorageParts, CTDataBinding db) -
xpathGetString
public static java.lang.String xpathGetString(WordprocessingMLPackage pkg, java.util.Map<java.lang.String,CustomXmlPart> customXmlDataStorageParts, java.lang.String storeItemId, java.lang.String xpath, java.lang.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:
-