Package org.xwiki.rendering.wikimodel
Class WikiReference
- java.lang.Object
-
- org.xwiki.rendering.wikimodel.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.
- Since:
- 4.0M1
- Version:
- $Id: 596c8202ad9bda50d9b41dccddaa9ab355182cd6 $
-
-
Constructor Summary
Constructors Constructor Description WikiReference(String link)
This constructor is used to initialize only the link part of the referenceWikiReference(String link, String label)
This constructor is used to initialize the link and label of this referenceWikiReference(String link, String label, WikiParameters params)
This constructor is used to initialize all internal fields of this class.WikiReference(String link, WikiParameters params)
This constructor is used to initialize the link and params fields
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getLabel()
Returns a human-readable label associated with this reference.String
getLink()
Returns a link of this reference.WikiParameters
getParameters()
Returns parameters associated with this reference.int
hashCode()
String
toString()
-
-
-
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 namelabel
- 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 namelabel
- the label corresponding to this referenceparams
- 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 nameparams
- a list of parameters of this reference
-
-
Method Detail
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
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 returnnull
.- 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 returnsnull
. If there is no specific parameters for the reference then this method returns theWikiParameters.EMPTY
instance.- Returns:
- a non-
null
object representing parameters of this link
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-