Package com.atlassian.confluence.links
Class ConfluenceLinkResolver
- java.lang.Object
-
- com.atlassian.confluence.links.ConfluenceLinkResolver
-
- All Implemented Interfaces:
com.atlassian.renderer.links.LinkResolver
@Transactional(readOnly=true) public class ConfluenceLinkResolver extends Object implements com.atlassian.renderer.links.LinkResolver
How Confluence converts text into links
-
-
Constructor Summary
Constructors Constructor Description ConfluenceLinkResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.atlassian.renderer.links.Link
createLink(com.atlassian.renderer.RenderContext context, String linkText)
List<com.atlassian.renderer.links.Link>
extractLinks(com.atlassian.renderer.RenderContext context, String pageContent)
Parses the content passed in and returns a list of confluence link objects (e.g.List<String>
extractLinkTextList(String pageContent)
parses through the content and returns a list of all the links found in string format e.g.static String
getLinkAsPlainText(String linkBody, String url)
static boolean
isUrlLink(String textWithoutTitle)
String
removeLinkBrackets(String linkText)
removes "[" and "]" from the link text if its existsvoid
setAttachmentManager(AttachmentManager attachmentManager)
void
setConfluenceUserResolver(ConfluenceUserResolver confluenceUserResolver)
void
setContentEntityManager(ContentEntityManager contentEntityManager)
void
setMacroManager(com.atlassian.renderer.v2.macro.MacroManager macroManager)
void
setPageManager(PageManager pageManager)
void
setPermissionManager(PermissionManager permissionManager)
void
setPersonalInformationManager(PersonalInformationManager personalInformationManager)
void
setSettingsManager(SettingsManager settingsManager)
void
setShortcutLinksManager(ShortcutLinksManager shortcutLinksManager)
void
setSpaceManager(SpaceManager spaceManager)
void
setStorageFormatCleaner(StorageFormatCleaner storageFormatCleaner)
-
-
-
Method Detail
-
extractLinkTextList
public List<String> extractLinkTextList(String pageContent)
parses through the content and returns a list of all the links found in string format e.g. {"[foo]","[alias|bar]", "[http://www.google.com]"- Specified by:
extractLinkTextList
in interfacecom.atlassian.renderer.links.LinkResolver
-
extractLinks
public List<com.atlassian.renderer.links.Link> extractLinks(com.atlassian.renderer.RenderContext context, String pageContent)
Parses the content passed in and returns a list of confluence link objects (e.g. AttachmentLink, BaseLink etc)- Specified by:
extractLinks
in interfacecom.atlassian.renderer.links.LinkResolver
-
removeLinkBrackets
public String removeLinkBrackets(String linkText)
removes "[" and "]" from the link text if its exists- Specified by:
removeLinkBrackets
in interfacecom.atlassian.renderer.links.LinkResolver
-
getLinkAsPlainText
public static String getLinkAsPlainText(String linkBody, String url)
- Parameters:
linkBody
-url
-- Returns:
- a string representation of the link with the link body followed by the url in brackets, or just the URL if the body is the same.
-
createLink
public com.atlassian.renderer.links.Link createLink(com.atlassian.renderer.RenderContext context, String linkText)
- Specified by:
createLink
in interfacecom.atlassian.renderer.links.LinkResolver
-
isUrlLink
public static boolean isUrlLink(String textWithoutTitle)
-
setSettingsManager
public void setSettingsManager(SettingsManager settingsManager)
-
setShortcutLinksManager
public void setShortcutLinksManager(ShortcutLinksManager shortcutLinksManager)
-
setPageManager
public void setPageManager(PageManager pageManager)
-
setSpaceManager
public void setSpaceManager(SpaceManager spaceManager)
-
setConfluenceUserResolver
public void setConfluenceUserResolver(ConfluenceUserResolver confluenceUserResolver)
- Since:
- 7.16
-
setAttachmentManager
public void setAttachmentManager(AttachmentManager attachmentManager)
-
setContentEntityManager
public void setContentEntityManager(ContentEntityManager contentEntityManager)
-
setPermissionManager
public void setPermissionManager(PermissionManager permissionManager)
-
setMacroManager
public void setMacroManager(com.atlassian.renderer.v2.macro.MacroManager macroManager)
-
setPersonalInformationManager
public void setPersonalInformationManager(PersonalInformationManager personalInformationManager)
-
setStorageFormatCleaner
public void setStorageFormatCleaner(StorageFormatCleaner storageFormatCleaner)
-
-