org.xwiki.rendering.internal.parser.reference
Class DefaultResourceReferenceParser
java.lang.Object
org.xwiki.rendering.internal.parser.reference.DefaultResourceReferenceParser
- All Implemented Interfaces:
- ResourceReferenceParser
@Component
@Singleton
public class DefaultResourceReferenceParser
- extends java.lang.Object
- implements ResourceReferenceParser
Parses the content of resource references. The format of a resource reference is the following:
(type):(reference) where type represents the type (see
ResourceType of the resource pointed to (e.g. document, mailto,
attachment, image, document in another wiki, etc), and reference defines the target.
The syntax of reference depends on the Resource type and is documented in the javadoc of the various
ResourceReferenceTypeParser implementations.
Note that the implementation is pluggable and it's allowed plug new resource reference types by implementing
ResourceReferenceTypeParsers and registering the implementation as a component.
- Since:
- 2.6M1
- Version:
- $Id$
|
Field Summary |
static java.lang.String |
TYPE_SEPARATOR
Link Reference Type separator (eg "mailto:mail@address"). |
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE_SEPARATOR
public static final java.lang.String TYPE_SEPARATOR
- Link Reference Type separator (eg "mailto:mail@address").
- See Also:
- Constant Field Values
DefaultResourceReferenceParser
public DefaultResourceReferenceParser()
parse
public 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.
- Specified by:
parse in interface ResourceReferenceParser
- Parameters:
rawReference - the string representation of the resource reference to parse (the supported syntax depends
on the parser implementation used)
- Returns:
- the parsed resource reference or a Resource Reference with
ResourceType.UNKNOWN if no reference
type was specified - See Also:
ResourceReferenceParser.parse(String)
Copyright © 2004-2011 XWiki. All Rights Reserved.