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

File MacroMarkerBlock.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
56% of files have more coverage

Code metrics

0
5
5
1
82
31
5
1
1
5
1

Classes

Class Line # Actions
MacroMarkerBlock 35 5 0% 5 2
0.880%
 

Contributing tests

This file is covered by 280 tests. .

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    package org.xwiki.rendering.block;
21   
22    import java.util.List;
23    import java.util.Map;
24   
25    import org.xwiki.rendering.listener.Listener;
26   
27    /**
28    * A special block that Macro Blocks generate when they are executed so that it's possible to reconstruct the initial
29    * syntax even after Macros have been executed. For example this is important in a WYSWIYG editor where you want to show
30    * the Macro's rendered result and also let users modify the macro content.
31    *
32    * @version $Id: a236c03b4f7104b0ae260745edca7ded2f5523d9 $
33    * @since 1.5M2
34    */
 
35    public class MacroMarkerBlock extends AbstractMacroBlock
36    {
37    /**
38    * @param id the name of the macro
39    * @param parameters the parameters of the macro
40    * @param childBlocks the list of children blocks generated by the macro
41    * @param isInline indicate if the macro is located in a inline content (like paragraph, etc.)
42    */
 
43  14 toggle public MacroMarkerBlock(String id, Map<String, String> parameters, List<Block> childBlocks, boolean isInline)
44    {
45  14 this(id, parameters, null, childBlocks, isInline);
46    }
47   
48    /**
49    * @param id the name of the macro
50    * @param parameters the parameters of the macro
51    * @param content the content of the macro. Null if the macro does not have content
52    * @param childBlocks the list of children blocks generated by the macro
53    * @param inline indicate if the macro is located in a inline content (like paragraph, etc.)
54    */
 
55  533696 toggle public MacroMarkerBlock(String id, Map<String, String> parameters, String content, List<Block> childBlocks,
56    boolean inline)
57    {
58  533678 super(childBlocks, parameters, id, content, inline);
59    }
60   
61    /**
62    * @return the macro name.
63    * @deprecated since 2.4M1 use {@link #getId()} instead
64    */
 
65  0 toggle @Deprecated
66    public String getName()
67    {
68  0 return getId();
69    }
70   
 
71  685563 toggle @Override
72    public void before(Listener listener)
73    {
74  685571 listener.beginMacroMarker(getId(), getParameters(), getContent(), isInline());
75    }
76   
 
77  685567 toggle @Override
78    public void after(Listener listener)
79    {
80  685570 listener.endMacroMarker(getId(), getParameters(), getContent(), isInline());
81    }
82    }