Package org.apache.wiki.parser
Class LinkParsingOperations
java.lang.Object
org.apache.wiki.parser.LinkParsingOperations
public class LinkParsingOperations extends java.lang.Object
Link parsing operations.
- Since:
- 2.10.3
-
Constructor Summary
Constructors Constructor Description LinkParsingOperations(Context wikiContext)
-
Method Summary
Modifier and Type Method Description int
interWikiLinkAt(java.lang.String page)
Returns true, if this Link represents an InterWiki link (of the form wiki:page).boolean
isAccessRule(java.lang.String link)
Returns true, if the link in question is an access rule.boolean
isExternalLink(java.lang.String page)
Figures out if a link is an off-site link.boolean
isImageLink(java.lang.String link, boolean isImageInlining, java.util.List<org.apache.oro.text.regex.Pattern> inlineImagePatterns)
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(java.lang.String page)
Returns true, if this Link represents an InterWiki link (of the form wiki:page).boolean
isMetadata(java.lang.String link)
Returns true if the link is a metadata link.boolean
isPluginLink(java.lang.String link)
Returns true if the link is really command to insert a plugin.boolean
isVariableLink(java.lang.String link)
Returns true if the link is really command to insert a variable.boolean
linkExists(java.lang.String page)
Returnstrue
, if the link name exists; otherwise it returnsfalse
.java.lang.String
linkIfExists(java.lang.String page)
Returns link name, if it exists; otherwise it returnsnull
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
LinkParsingOperations
-
-
Method Details
-
isAccessRule
Returns true, if the link in question is an access rule.- Parameters:
link
- The link text- Returns:
true
, if this represents an access rule.
-
isPluginLink
Returns true if the link is really command to insert a plugin.Currently we just check if the link starts with "{INSERT", or just plain "{" but not "{$".
- Parameters:
link
- Link text, i.e. the contents of text between [].- Returns:
- True, if this link seems to be a command to insert a plugin here.
-
isMetadata
Returns true if the link is a metadata link.- Parameters:
link
- The link text- Returns:
true
, if this represents a metadata link.
-
isVariableLink
Returns true if the link is really command to insert a variable.Currently we just check if the link starts with "{$".
- Parameters:
link
- The link text- Returns:
true
, if this represents a variable link.
-
isInterWikiLink
Returns true, if this Link represents an InterWiki link (of the form wiki:page).- Returns:
true
, if this Link represents an InterWiki link,false
otherwise.
-
interWikiLinkAt
Returns true, if this Link represents an InterWiki link (of the form wiki:page).- Returns:
true
, if this Link represents an InterWiki link,false
otherwise.
-
isExternalLink
Figures out if a link is an off-site link. This recognizes the most common protocols by checking how it starts.- Parameters:
page
- The link to check.- Returns:
- true, if this is a link outside of this wiki.
-
isImageLink
public boolean isImageLink(java.lang.String link, boolean isImageInlining, java.util.List<org.apache.oro.text.regex.Pattern> inlineImagePatterns)Matches the given link to the list of image name patterns to determine whether it should be treated as an inline image or not. -
linkExists
Returnstrue
, if the link name exists; otherwise it returnsfalse
.- Parameters:
page
- link name- Returns:
true
, if the link name exists; otherwise it returnsfalse
.
-
linkIfExists
Returns link name, if it exists; otherwise it returnsnull
.- Parameters:
page
- link name- Returns:
- link name, if it exists; otherwise it returns
null
.
-