public class LinkParsingOperations extends Object
Constructor and Description |
---|
LinkParsingOperations(WikiContext wikiContext) |
Modifier and Type | Method and Description |
---|---|
int |
interWikiLinkAt(String page)
Returns true, if this Link represents an InterWiki link (of the form wiki:page).
|
boolean |
isAccessRule(String link)
Returns true, if the link in question is an access rule.
|
boolean |
isExternalLink(String page)
Figures out if a link is an off-site link.
|
boolean |
isImageLink(String link)
Matches the given link to the list of image name patterns to
determine whether it should be treated as an inline image or not.
|
boolean |
isInterWikiLink(String page)
Returns true, if this Link represents an InterWiki link (of the form wiki:page).
|
boolean |
isMetadata(String link)
Returns true if the link is a metadata link.
|
boolean |
isPluginLink(String link)
Returns true if the link is really command to insert a plugin.
|
boolean |
isVariableLink(String link)
Returns true if the link is really command to insert a variable.
|
boolean |
linkExists(String page)
Returns
true , if the link name exists; otherwise it returns false . |
String |
linkIfExists(String page)
Returns link name, if it exists; otherwise it returns
null . |
public LinkParsingOperations(WikiContext wikiContext)
public boolean isAccessRule(String link)
link
- The link texttrue
, if this represents an access rule.public boolean isPluginLink(String link)
Currently we just check if the link starts with "{INSERT", or just plain "{" but not "{$".
link
- Link text, i.e. the contents of text between [].public boolean isMetadata(String link)
link
- The link texttrue
, if this represents a metadata link.public boolean isVariableLink(String link)
Currently we just check if the link starts with "{$".
link
- The link texttrue
, if this represents a variable link.public boolean isInterWikiLink(String page)
true
, if this Link represents an InterWiki link, false
otherwise.public int interWikiLinkAt(String page)
true
, if this Link represents an InterWiki link, false
otherwise.public boolean isExternalLink(String page)
page
- The link to check.public boolean isImageLink(String link)
public boolean linkExists(String page)
true
, if the link name exists; otherwise it returns false
.page
- link nametrue
, if the link name exists; otherwise it returns false
.public String linkIfExists(String page)
null
.page
- link namenull
.Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.