com.atlassian.renderer.links
Class GenericLinkParser

java.lang.Object
  extended by com.atlassian.renderer.links.GenericLinkParser

public class GenericLinkParser
extends Object


Constructor Summary
GenericLinkParser(String linkText)
           
 
Method Summary
static String divideOn(StringBuffer buffer, char divider)
          Split a StringBuffer on some dividing character.
 String getAnchor()
           
 String getAttachmentName()
           
 long getContentId()
          Gets the content id parsed.
 String getDestinationTitle()
          Gets the title of the destination content.
 String getLinkBody()
           
 String getLinkTitle()
           
 String getNotLinkBody()
           
 String getOriginalLinkText()
           
 String getShortcutName()
          Returns the name of the shortcut.
 String getShortcutValue()
          Returns the value of the shortcut.
 String getSpaceKey()
           
 void parseAsContentLink()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericLinkParser

public GenericLinkParser(String linkText)
Method Detail

parseAsContentLink

public void parseAsContentLink()
                        throws ParseException
Throws:
ParseException

getOriginalLinkText

public String getOriginalLinkText()

getLinkBody

public String getLinkBody()

getNotLinkBody

public String getNotLinkBody()

getSpaceKey

public String getSpaceKey()

getDestinationTitle

public String getDestinationTitle()
Gets the title of the destination content. Only populated by calling parseAsContentLink(), empty string otherwise.


getAnchor

public String getAnchor()

getShortcutName

public String getShortcutName()
Returns the name of the shortcut. Only populated by calling parseAsContentLink(). Null if not parsed as content link or if the link isn't a shortcut link.


getShortcutValue

public String getShortcutValue()
Returns the value of the shortcut. Only populated by calling parseAsContentLink(). Null if not parsed as content link or if the link isn't a shortcut link.


getLinkTitle

public String getLinkTitle()

getAttachmentName

public String getAttachmentName()

getContentId

public long getContentId()
Gets the content id parsed. Returns 0 if not defined in the original link text.


divideOn

public static String divideOn(StringBuffer buffer,
                              char divider)
Split a StringBuffer on some dividing character. Return everything before the divider, and remove that prefix _and_ the divider from the StringBuffer. If there is no divider, return null.

If the buffer begins with the divider, then the divider will be removed _and_ null returned. If the buffer ends with the divider, everything before the divider is returned and the buffer will remain empty.

Parameters:
buffer - the text we want to divide. Will be modified during the operation
divider - the character to divide the buffer on
Returns:
the characters before the divider, or the default if there are none


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.