Package org.docx4j.model.datastorage
Class BindingHyperlinkResolver
java.lang.Object
org.docx4j.model.datastorage.BindingHyperlinkResolver
- Direct Known Subclasses:
BindingHyperlinkResolverForOpenAPI3
public class BindingHyperlinkResolver
extends java.lang.Object
Override this class if you want to customise hyperlink handling.
You can override what is recognised as a URL, and how that is
converted into a hyperlink.
- Since:
- 3.0.0
- Author:
- jharrop
-
Constructor Summary
Constructors Constructor Description BindingHyperlinkResolver() -
Method Summary
Modifier and Type Method Description voidactivateHyperlinkStyle(WordprocessingMLPackage wordMLPackage)Enable the hyperlinkStyle in the docx.P.HyperlinkgenerateHyperlink(java.lang.String relId, java.lang.String url)java.lang.StringgetHyperlinkStyleId()intgetIndexOfURL(java.lang.String text)Return the index of the position you wish to treat as a hyperlink.voidsetHyperlinkStyle(java.lang.String hyperlinkStyleID)
-
Constructor Details
-
BindingHyperlinkResolver
public BindingHyperlinkResolver()
-
-
Method Details
-
setHyperlinkStyle
public void setHyperlinkStyle(java.lang.String hyperlinkStyleID) -
getHyperlinkStyleId
public java.lang.String getHyperlinkStyleId() -
getIndexOfURL
public int getIndexOfURL(java.lang.String text)Return the index of the position you wish to treat as a hyperlink. The characters from there to the first whitespace following will be treated as the URL- Parameters:
text-- Returns:
-
generateHyperlink
public P.Hyperlink generateHyperlink(java.lang.String relId, java.lang.String url) throws javax.xml.bind.JAXBException- Parameters:
relId-url-- Returns:
- Throws:
javax.xml.bind.JAXBException
-
activateHyperlinkStyle
Enable the hyperlinkStyle in the docx.- Parameters:
wordMLPackage-hyperlinkStyleId-
-