org.wikimodel.wem
Class WikiReference

java.lang.Object
  extended by org.wikimodel.wem.WikiReference

public class WikiReference
extends java.lang.Object

This object represents an individual reference in the wiki document. A reference contains the following parts:

Instances of this type are immutable so they can be shared between various contexts (like threads, parser instances and so on).

Author:
kotelnikov

Constructor Summary
WikiReference(java.lang.String link)
          This constructor is used to initialize only the link part of the reference
WikiReference(java.lang.String link, java.lang.String label)
          This constructor is used to initialize the link and label of this reference
WikiReference(java.lang.String link, java.lang.String label, WikiParameters params)
          This constructor is used to initialize all internal fields of this class.
WikiReference(java.lang.String link, WikiParameters params)
          This constructor is used to initialize the link and params fields
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getLabel()
          Returns a human-readable label associated with this reference.
 java.lang.String getLink()
          Returns a link of this reference.
 WikiParameters getParameters()
          Returns parameters associated with this reference.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WikiReference

public WikiReference(java.lang.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(java.lang.String link,
                     java.lang.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(java.lang.String link,
                     java.lang.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(java.lang.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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getLabel

public java.lang.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 java.lang.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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2005-2010. All Rights Reserved.