Package org.commonmark.node
Class Link
- java.lang.Object
-
- org.commonmark.node.Node
-
- org.commonmark.node.Link
-
public class Link extends Node
A link with a destination and an optional title; the link text is in child nodes.Example for an inline link in a CommonMark document:
[link](/uri "title")The corresponding Link node would look like this:
getDestination()returns"/uri"getTitle()returns"title"- A
Textchild node withgetLiteralthat returns"link"
Note that the text in the link can contain inline formatting, so it could also contain an
ImageorEmphasis, etc.- See Also:
- CommonMark Spec for links
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringdestinationprivate java.lang.Stringtitle
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)java.lang.StringgetDestination()java.lang.StringgetTitle()voidsetDestination(java.lang.String destination)voidsetTitle(java.lang.String title)protected java.lang.StringtoStringAttributes()-
Methods inherited from class org.commonmark.node.Node
addSourceSpan, appendChild, getFirstChild, getLastChild, getNext, getParent, getPrevious, getSourceSpans, insertAfter, insertBefore, prependChild, setParent, setSourceSpans, toString, unlink
-
-
-
-
Method Detail
-
getDestination
public java.lang.String getDestination()
-
setDestination
public void setDestination(java.lang.String destination)
-
getTitle
public java.lang.String getTitle()
- Returns:
- the title or null
-
setTitle
public void setTitle(java.lang.String title)
-
toStringAttributes
protected java.lang.String toStringAttributes()
- Overrides:
toStringAttributesin classNode
-
-