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:

Note that the text in the link can contain inline formatting, so it could also contain an Image or Emphasis, etc.

See Also:
  • Field Details

    • destination

      private String destination
    • title

      private String title
  • Constructor Details

    • Link

      public Link()
    • Link

      public Link(String destination, String title)
  • Method Details

    • accept

      public void accept(Visitor visitor)
      Specified by:
      accept in class Node
    • getDestination

      public String getDestination()
    • setDestination

      public void setDestination(String destination)
    • getTitle

      public String getTitle()
      Returns:
      the title or null
    • setTitle

      public void setTitle(String title)
    • toStringAttributes

      protected String toStringAttributes()
      Overrides:
      toStringAttributes in class Node