Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
TypedStringEntityReferenceResolver | 41 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.annotation.reference; | |
21 | ||
22 | import org.xwiki.component.annotation.Role; | |
23 | import org.xwiki.model.EntityType; | |
24 | import org.xwiki.model.reference.EntityReference; | |
25 | ||
26 | /** | |
27 | * Typed version of the entity reference resolver from string representations which gets its type from the string | |
28 | * serialization, in the form {@code type://} and, if no such type specification is found, it uses the default passed | |
29 | * type. <br> | |
30 | * For example, something like: {@code DOCUMENT://XWiki.TagClass[0]#tags} will result in parsing {@code | |
31 | * XWiki.TagClass[0]#tags} as a document reference, while {OBJECT_PROPERTY://XWiki.TagClass[0]#tags} will result in | |
32 | * parsing {@code XWiki.TagClass[0]#tags} as an object property reference.<br> | |
33 | * Note that, although it roughly does the same thing, this is a different hierarchy than EntityReferenceResolver | |
34 | * because it's a different strategy, different interpretation of the type parameter and resolvers and serializers of | |
35 | * this type should be used together. | |
36 | * | |
37 | * @version $Id: e45682da9325e596fd4dabf798a5835c4f15c9f8 $ | |
38 | * @since 2.3M1 | |
39 | */ | |
40 | @Role | |
41 | public interface TypedStringEntityReferenceResolver | |
42 | { | |
43 | /** | |
44 | * @param entityReferenceRepresentation representation of the entity, with or without a type (e.g. {@code | |
45 | * DOCUMENT://wiki:Space.Page} or {@code wiki:Space.WebHome}) | |
46 | * @param type the default type to be used if none is specified in the serialization | |
47 | * @return the resolved entity reference | |
48 | */ | |
49 | EntityReference resolve(String entityReferenceRepresentation, EntityType type); | |
50 | } |