Class WikiReference


  • public class WikiReference
    extends Object
    This object represents an individual reference in the wiki document. A reference contains the following parts:
    • link (mandatory) - it can b e a hyperlink, URI or a wiki page name
    • label (optional) - a human readable label associated with this reference
    • parameters (optional) - additional wiki parameters associated with the reference. It can be a style name, a target of the link or something else.
    Instances of this type are immutable so they can be shared between various contexts (like threads, parser instances and so on).
    Since:
    4.0M1
    Version:
    $Id: 596c8202ad9bda50d9b41dccddaa9ab355182cd6 $
    • Constructor Detail

      • WikiReference

        public WikiReference​(String link)
        This constructor is used to initialize only the link part of the reference
        Parameters:
        link - the link corresponding to the reference; it can be a hyperlink, URI or a wiki name
      • WikiReference

        public WikiReference​(String link,
                             String label)
        This constructor is used to initialize the link and label of this reference
        Parameters:
        link - the link corresponding to the reference; it can be a hyperlink, URI or a wiki name
        label - the label corresponding to this reference
      • WikiReference

        public WikiReference​(String link,
                             String label,
                             WikiParameters params)
        This constructor is used to initialize all internal fields of this class.
        Parameters:
        link - the link corresponding to the reference; it can be a hyperlink, URI or a wiki name
        label - the label corresponding to this reference
        params - a list of parameters of this reference
      • WikiReference

        public WikiReference​(String link,
                             WikiParameters params)
        This constructor is used to initialize the link and params fields
        Parameters:
        link - the link corresponding to the reference; it can be a hyperlink, URI or a wiki name
        params - a list of parameters of this reference
    • Method Detail

      • getLabel

        public String getLabel()
        Returns a human-readable label associated with this reference. This is an optional part of the reference so this method can return null.
        Returns:
        a human-readable label associated with this reference
      • getLink

        public String getLink()
        Returns a link of this reference. It can be an a hyperlink, an URI or a wiki name. This part of the reference is mandatory so the returned value is not empty.
        Returns:
        a link associated with this reference
      • getParameters

        public WikiParameters getParameters()
        Returns parameters associated with this reference. This method never returns null. If there is no specific parameters for the reference then this method returns the WikiParameters.EMPTY instance.
        Returns:
        a non-null object representing parameters of this link