Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
RenderingContext | 35 | 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 | ||
21 | package org.xwiki.rendering.transformation; | |
22 | ||
23 | import org.xwiki.component.annotation.Role; | |
24 | import org.xwiki.rendering.block.Block; | |
25 | import org.xwiki.rendering.block.XDOM; | |
26 | import org.xwiki.rendering.syntax.Syntax; | |
27 | ||
28 | /** | |
29 | * The context of the rendering engine during transformation. | |
30 | * | |
31 | * @version $Id: 438a5fbc36cc223c6e78aaa596b540799b26c966 $ | |
32 | * @since 6.0 | |
33 | */ | |
34 | @Role | |
35 | public interface RenderingContext extends Cloneable | |
36 | { | |
37 | /** | |
38 | * @return the complete {@link XDOM} of the content currently being transformed. | |
39 | */ | |
40 | XDOM getXDOM(); | |
41 | ||
42 | /** | |
43 | * @return the current {@link Block} being processed by the transformation. Currently, on the macro transformation | |
44 | * report here the currently processed macro block. | |
45 | */ | |
46 | Block getCurrentBlock(); | |
47 | ||
48 | /** | |
49 | * @return the default syntax to fallback on if not provided by a block, the XDOM or some other means. | |
50 | */ | |
51 | Syntax getDefaultSyntax(); | |
52 | ||
53 | /** | |
54 | * @return true if the current transformation is executed in a restricted context. In a restricted context, | |
55 | * potentially insecure transformations should not be executed, like the html and scripts macros. | |
56 | */ | |
57 | boolean isRestricted(); | |
58 | ||
59 | /** | |
60 | * @return the current Transformation instance being executed. Useful for Macros which need to perform other | |
61 | * transformations in turn such as the Include macro which needs to execute the transformation if the | |
62 | * included page should be executed in its own context. | |
63 | */ | |
64 | Transformation getTransformation(); | |
65 | ||
66 | /** | |
67 | * @return an id representing the transformation being evaluated. It's a free form name that may be used to perform | |
68 | * some caching based on a key. For example the Velocity Macro is using this id to pass it to the underlying | |
69 | * Velocity Engine so that it caches macros using this key. | |
70 | */ | |
71 | String getTransformationId(); | |
72 | ||
73 | /** | |
74 | * @return the syntax of the renderer that is going to be used, can be null if the renderer is unknown or if blocks | |
75 | * are not being rendered (for example if the Rendering is used for parsing content) | |
76 | * @since 6.2M1 | |
77 | */ | |
78 | Syntax getTargetSyntax(); | |
79 | } |