/** * If this Hyperlink is an external reference hyperlink, * return the object for it. */ public XWPFHyperlink getHyperlink(XWPFDocument document) { String id = getHyperlinkId(); if (id == null) return null; return document.getHyperlinkByID(id); } }
/** * If this Hyperlink is an external reference hyperlink, * return the object for it. */ public XWPFHyperlink getHyperlink(XWPFDocument document) { String id = getHyperlinkId(); if (id == null) return null; return document.getHyperlinkByID(id); } }
/** * If this Hyperlink is an external reference hyperlink, * return the object for it. */ public XWPFHyperlink getHyperlink(XWPFDocument document) { String id = getHyperlinkId(); if(id == null) return null; return document.getHyperlinkByID(id); } }
/** * @param prgrph The paragraph of text to work on * @param outputHyperlinkUrls Should we output the links too, or just the link text? */ public XWPFHyperlinkDecorator(XWPFParagraph prgrph, XWPFParagraphDecorator nextDecorator, boolean outputHyperlinkUrls) { super(prgrph, nextDecorator); hyperlinkText = new StringBuffer(); // loop over hyperlink anchors for(CTHyperlink link : paragraph.getCTP().getHyperlinkList()){ for (CTR r : link.getRList()) { // Loop over text runs for (CTText text : r.getTList()){ hyperlinkText.append(text.getStringValue()); } } if(outputHyperlinkUrls && paragraph.getDocument().getHyperlinkByID(link.getId()) != null) { hyperlinkText.append(" <"+paragraph.getDocument().getHyperlinkByID(link.getId()).getURL()+">"); } } }
if ( StringUtils.isNotEmpty( hyperlinkId ) ) XWPFHyperlink hyperlink = document.getHyperlinkByID( hyperlinkId ); href = hyperlink != null ? hyperlink.getURL() : null;
if ( StringUtils.isNotEmpty( hyperlinkId ) ) XWPFHyperlink hyperlink = document.getHyperlinkByID( hyperlinkId ); href = hyperlink != null ? hyperlink.getURL() : null;
if ( StringUtils.isNotEmpty( hyperlinkId ) ) XWPFHyperlink hyperlink = document.getHyperlinkByID( hyperlinkId ); href = hyperlink != null ? hyperlink.getURL() : null;