Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
IOTargetService | 34 | 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.io; | |
21 | ||
22 | import org.xwiki.component.annotation.Role; | |
23 | import org.xwiki.rendering.block.XDOM; | |
24 | ||
25 | /** | |
26 | * This service provides functions to operate with annotations targets. It operates with string serialized references to | |
27 | * such targets. This interface does not restrict the implementation of the annotation targets, they can be anything | |
28 | * referencable through a string. | |
29 | * | |
30 | * @version $Id: cb1a0b03aa5ddd676ab46eb116e54879ce1bdef3 $ | |
31 | * @since 2.3M1 | |
32 | */ | |
33 | @Role | |
34 | public interface IOTargetService | |
35 | { | |
36 | /** | |
37 | * @param reference serialized string reference of the content to get the source for | |
38 | * @return the source of the referenced content | |
39 | * @throws IOServiceException if any exception occurs when manipulating sources | |
40 | * @deprecated use {@link #getXDOM(String)} | |
41 | */ | |
42 | @Deprecated | |
43 | String getSource(String reference) throws IOServiceException; | |
44 | ||
45 | /** | |
46 | * @param reference serialized string reference of the content whose syntax to return | |
47 | * @return the syntax of the source of the referenced content | |
48 | * @throws IOServiceException if any exception occurs when manipulating sources | |
49 | */ | |
50 | String getSourceSyntax(String reference) throws IOServiceException; | |
51 | ||
52 | /** | |
53 | * @param reference serialized string reference of the content to get the XDOM for | |
54 | * @return the XDOM of the referenced content | |
55 | * @throws IOServiceException if any exception occurs when manipulating sources | |
56 | * @since 6.2 | |
57 | * | |
58 | * TODO: While we use String for reference to stay in the style of the existing API, it would be better to use | |
59 | * EntityReference when this API get more largely refactored. | |
60 | */ | |
61 | XDOM getXDOM(String reference) throws IOServiceException; | |
62 | ||
63 | /** | |
64 | * @param reference serialized string reference of the content to get the XDOM for | |
65 | * @param syntax the syntax of the source of the referenced content | |
66 | * @return the XDOM of the referenced content | |
67 | * @throws IOServiceException if any exception occurs when manipulating sources | |
68 | * @since 6.2 | |
69 | * | |
70 | * TODO: While we use String for reference and syntax to stay in the style of the existing API, it would be | |
71 | * better to use EntityReference and SyntaxId when this API get more largely refactored. | |
72 | */ | |
73 | XDOM getXDOM(String reference, String syntax) throws IOServiceException; | |
74 | } |