1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.rendering.internal.transformation

File MutableRenderingContext.java

 

Code metrics

0
0
0
1
89
19
0
-
-
0
-

Classes

Class Line # Actions
MutableRenderingContext 37 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

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.internal.transformation;
22   
23    import org.xwiki.rendering.block.Block;
24    import org.xwiki.rendering.block.XDOM;
25    import org.xwiki.rendering.syntax.Syntax;
26    import org.xwiki.rendering.transformation.RenderingContext;
27    import org.xwiki.rendering.transformation.Transformation;
28    import org.xwiki.rendering.transformation.TransformationContext;
29    import org.xwiki.rendering.transformation.TransformationException;
30   
31    /**
32    * An interface to update the rendering context internally during transformations.
33    *
34    * @version $Id: 170804298991075bbaa88357c299b5c44e15f414 $
35    * @since 6.0RC1
36    */
 
37    public interface MutableRenderingContext extends RenderingContext
38    {
39    /**
40    * Push a new rendering context.
41    *
42    * @param transformation the transformation being performed.
43    * @param context the transformation context.
44    */
45    void push(Transformation transformation, TransformationContext context);
46   
47    /**
48    * Push a new rendering context.
49    *
50    * @param transformation the transformation being performed.
51    * @param xdom the complete XDOM being processed.
52    * @param syntax the current syntax.
53    * @param transformationId the id of the transformation.
54    * @param restricted true if the transformation is restricted.
55    * @param targetSyntax the syntax of the renderer
56    */
57    void push(Transformation transformation, XDOM xdom, Syntax syntax, String transformationId, boolean restricted,
58    Syntax targetSyntax);
59   
60    /**
61    * Pop the rendering context.
62    */
63    void pop();
64   
65    /**
66    * Helper to run a transformation while properly updating the rendering context.
67    *
68    * @param transformation the transformation to apply.
69    * @param context the transformation context.
70    * @param block the block to apply the transformation on.
71    * @throws TransformationException see {@link Transformation#transform(Block, TransformationContext)}.
72    */
73    void transformInContext(Transformation transformation, TransformationContext context, Block block)
74    throws TransformationException;
75   
76    /**
77    * Set the current block.
78    *
79    * @param block the block current being processed by the transformation.
80    */
81    void setCurrentBlock(Block block);
82   
83    /**
84    * Set the target syntax.
85    *
86    * @param targetSyntax the target syntax
87    */
88    void setTargetSyntax(Syntax targetSyntax);
89    }