setAnchor(pHyperlink.getAnchor()); setDocLocation(pHyperlink.getDocLocation()); setRId(pHyperlink.getId()); setTgtFrame(pHyperlink.getTgtFrame()); setTooltip(pHyperlink.getTooltip());
@Override public List<Object> apply(Object o) { if (o instanceof P.Hyperlink) { P.Hyperlink hyperlink = (P.Hyperlink) o; try { Relationships contents = mainDocumentPart.getRelationshipsPart().getContents(); List<Relationship> relationships = contents.getRelationship(); for (Relationship relationship : relationships) { if (relationship.getId().equals(hyperlink.getId())) { relationship.setTarget(docxFormatter.handleStringWithAliases(URLDecoder.decode(relationship.getTarget(), "UTF-8"))); } } } catch (Exception e) { throw new RuntimeException("An error occurred while processing URL with aliases",e); } } return null; } }
@Override public List<Object> apply(Object o) { if (o instanceof P.Hyperlink) { P.Hyperlink hyperlink = (P.Hyperlink) o; try { Relationships contents = mainDocumentPart.getRelationshipsPart().getContents(); List<Relationship> relationships = contents.getRelationship(); for (Relationship relationship : relationships) { if (relationship.getId().equals(hyperlink.getId())) { relationship.setTarget(docxFormatter.handleStringWithAliases(URLDecoder.decode(relationship.getTarget(), "UTF-8"))); } } } catch (Exception e) { throw new RuntimeException("An error occurred while processing URL with aliases",e); } } return null; } }
setAnchor(pHyperlink.getAnchor()); setDocLocation(pHyperlink.getDocLocation()); setRId(pHyperlink.getId()); setTgtFrame(pHyperlink.getTgtFrame()); setTooltip(pHyperlink.getTooltip());