public class Link extends Object implements Cloneable
(alias[|>])(link)(@interWikiAlias)(|target)
, where:
alias
: An optional string which will be displayed to the user as the link
name when rendered. Example: "My Page".link
: The full link reference using the following syntax:
(virtualWikiAlias:)(space.)(reference)(?queryString)(#anchor)
, where:
virtualWikiAlias
: An optional string containing the name of a virtual
wiki. The link will point to a page inside that virtual wiki. Example: "mywiki".space
: An optional Wiki Space name. Example: "Main".reference
: The link reference. This can be either a URI in the form
protocol:path
(example: "http://xwiki.org", "mailto:john@smith.com) or
a wiki page name (example: "WebHome").queryString
: An optional query string for specifying parameters that
will be used in the rendered URL. Example: "mydata1=5&mydata2=Hello".anchor
: An optional anchor name pointing to an anchor defined in the
referenced link. Note that in XWiki anchors are automatically created for titles.
Example: "TableOfContentAnchor".link
or the alias
must be specified.interWikiAlias
: An optional
Inter Wiki alias as defined in the
InterWiki Map. Example: "wikipedia"target
: An optional string corresponding to the HTML target
attribute for a a
element. This element is used when rendering the link. It
defaults to opening the link in the current page. Example: "_self", "_blank"Constructor and Description |
---|
Link() |
Modifier and Type | Method and Description |
---|---|
String |
getAlias() |
String |
getAnchor() |
String |
getInterWikiAlias() |
Link |
getNormalizedLink(String currentSpace)
Perform a series of normalization steps on the link.
|
String |
getPage() |
String |
getQueryString() |
String |
getSpace() |
String |
getTarget() |
URI |
getURI() |
String |
getVirtualWikiAlias() |
boolean |
isExternal() |
boolean |
isUsingPipeDelimiter() |
void |
setAlias(String alias) |
void |
setAnchor(String anchor) |
void |
setInterWikiAlias(String interWikiAlias) |
void |
setPage(String page) |
void |
setQueryString(String queryString) |
void |
setSpace(String space) |
void |
setTarget(String target) |
void |
setURI(URI uri) |
void |
setUsePipeDelimiterSymbol(boolean isUsingPipeDelimiter) |
void |
setVirtualWikiAlias(String virtualWikiAlias) |
String |
toString() |
public void setAlias(String alias)
alias
- see getAlias()
public String getAlias()
public void setTarget(String target)
target
- see getTarget()
public String getTarget()
target
attribute for the
a
element. It is used when rendering the link and defauts to opening
the link in the current page. Example: "_self", "_blank".public void setVirtualWikiAlias(String virtualWikiAlias)
virtualWikiAlias
- see getVirtualWikiAlias()
public String getVirtualWikiAlias()
public void setSpace(String space)
space
- see getSpace()
public String getSpace()
public void setInterWikiAlias(String interWikiAlias)
interWikiAlias
- see getInterWikiAlias()
public String getInterWikiAlias()
public void setAnchor(String anchor)
anchor
- see getAnchor()
public String getAnchor()
public void setQueryString(String queryString)
queryString
- see getQueryString()
public String getQueryString()
public String getPage()
public URI getURI()
public boolean isUsingPipeDelimiter()
public void setUsePipeDelimiterSymbol(boolean isUsingPipeDelimiter)
isUsingPipeDelimiter
- see isUsingPipeDelimiter()
public boolean isExternal()
public Link getNormalizedLink(String currentSpace)
currentSpace
- the space to use when no space has been defined in the linkCopyright © 2004–2014 XWiki. All rights reserved.