private void applyLinkAttributes(Attributes attributes, String href) { applyAttributes(attributes); boolean hasTarget = false; String rel = linkRel; if (attributes instanceof LinkAttributes) { LinkAttributes linkAttributes = (LinkAttributes) attributes; if (linkAttributes.getTarget() != null) { hasTarget = true; writer.writeAttribute("target", linkAttributes.getTarget()); //$NON-NLS-1$ } if (linkAttributes.getRel() != null) { rel = rel == null ? linkAttributes.getRel() : linkAttributes.getRel() + ' ' + rel; } } if (attributes.getTitle() != null && attributes.getTitle().length() > 0) { writer.writeAttribute("title", attributes.getTitle()); //$NON-NLS-1$ } if (!hasTarget && defaultAbsoluteLinkTarget != null && href != null) { if (isExternalLink(href)) { writer.writeAttribute("target", defaultAbsoluteLinkTarget); //$NON-NLS-1$ } } if (rel != null) { writer.writeAttribute("rel", rel); //$NON-NLS-1$ } }