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
Text
child node withgetLiteral
that returns"link"
Note that the text in the link can contain inline formatting, so it could also contain an
Image
orEmphasis
, etc.- See Also:
- CommonMark Spec for links
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
destination
private java.lang.String
title
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
java.lang.String
getDestination()
java.lang.String
getTitle()
void
setDestination(java.lang.String destination)
void
setTitle(java.lang.String title)
protected java.lang.String
toStringAttributes()
-
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:
toStringAttributes
in classNode
-
-