|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.rendering.internal.parser.reference.XWiki20LinkReferenceParser
@Component @Named(value="xwiki/2.0/link") @Singleton public class XWiki20LinkReferenceParser
Parses the content of XWiki 2.0 resource references.
The supported generic format is as follows: (link)(@interWikiAlias)?, where:
link: The full link reference using the following syntax:
(reference)(#anchor)?(?queryString)?, where:
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: "wiki:Space.WebHome").
Note that in the case of a wiki page name the character "\" is used as the escape character (for example if you
wish to have "#" or "?" in your page name you'll need to write "\#" and "\?").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".queryString: An optional query string for specifying parameters that will be used in the rendered
URL. Example: "mydata1=5&mydata2=Hello".link element is mandatory.interWikiAlias: An optional Inter Wiki alias as
defined in the InterWiki Map. Example: "wikipedia"http://, mailto:,
image: and attach:.
| Field Summary | |
|---|---|
static char |
ESCAPE_CHAR
Escape character to allow "#", "@" and "?" characters in a reference's name. |
static java.lang.String |
SEPARATOR_ANCHOR
Anchor separator. |
static java.lang.String |
SEPARATOR_INTERWIKI
Interwiki separator. |
static java.lang.String |
SEPARATOR_QUERYSTRING
Query String separator. |
| Constructor Summary | |
|---|---|
XWiki20LinkReferenceParser()
|
|
| Method Summary | |
|---|---|
protected java.util.List<java.lang.String> |
getAllowedURIPrefixes()
|
ResourceReference |
parse(java.lang.String rawReference)
Parses a resource reference represented (reference to a link, image, attachment, etc) as a String into a ResourceReference object. |
protected java.lang.String |
parseElementAfterString(java.lang.StringBuffer content,
java.lang.String separator)
Find out the element located to the right of the passed separator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SEPARATOR_INTERWIKI
public static final java.lang.String SEPARATOR_QUERYSTRING
public static final java.lang.String SEPARATOR_ANCHOR
public static final char ESCAPE_CHAR
| Constructor Detail |
|---|
public XWiki20LinkReferenceParser()
| Method Detail |
|---|
protected java.util.List<java.lang.String> getAllowedURIPrefixes()
public ResourceReference parse(java.lang.String rawReference)
ResourceReference object.
parse in interface ResourceReferenceParserrawReference - the string representation of the resource reference to parse (the supported syntax depends
on the parser implementation used)
ResourceReferenceParser.parse(java.lang.String)
protected java.lang.String parseElementAfterString(java.lang.StringBuffer content,
java.lang.String separator)
content - the string to parse. This parameter will be modified by the method to remove the parsed content.separator - the separator string to locate the element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||