1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.wikimodel.xml

File WemInlineTagNotifier.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart3.png
80% of files have more coverage

Code metrics

0
20
14
1
121
78
14
0.7
1.43
14
1

Classes

Class Line # Actions
WemInlineTagNotifier 31 20 0% 14 24
0.2941176629.4%
 

Contributing tests

This file is covered by 2 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.wikimodel.xml;
21   
22    import org.xwiki.rendering.wikimodel.IWemListenerInline;
23    import org.xwiki.rendering.wikimodel.WikiFormat;
24    import org.xwiki.rendering.wikimodel.WikiParameters;
25    import org.xwiki.rendering.wikimodel.WikiReference;
26   
27    /**
28    * @version $Id: f0697c1103d4e0e0a0fca2acdcd64e809414588e $
29    * @since 4.0M1
30    */
 
31    public class WemInlineTagNotifier extends AbstractTagNotifier
32    implements
33    IWemListenerInline
34    {
35    /**
36    * @param listener
37    */
 
38  6 toggle public WemInlineTagNotifier(ITagListener listener)
39    {
40  6 super(listener);
41    }
42   
 
43  11 toggle public void beginFormat(WikiFormat format)
44    {
45  11 fListener.beginTag(FORMAT, tagParams(format), userParams(format));
46    }
47   
 
48  11 toggle public void endFormat(WikiFormat format)
49    {
50  11 fListener.endTag(FORMAT, tagParams(format), userParams(format));
51    }
52   
 
53  0 toggle public void onEscape(String str)
54    {
55  0 fListener.beginTag(ESCAPE, EMPTY_MAP, EMPTY_MAP);
56  0 fListener.onText(str);
57  0 fListener.endTag(ESCAPE, EMPTY_MAP, EMPTY_MAP);
58    }
59   
 
60  0 toggle public void onImage(String ref)
61    {
62  0 WikiReference r = new WikiReference(ref);
63  0 fListener.onTag(
64    IMAGE,
65    tagParams(tagParams(r), IMAGE_IMPLICIT, "true"),
66    userParams(r));
67    }
68   
 
69  0 toggle public void onImage(WikiReference ref)
70    {
71  0 fListener.onTag(IMAGE, tagParams(
72    tagParams(ref),
73    IMAGE_IMPLICIT,
74    "false"), userParams(ref));
75    }
76   
 
77  0 toggle public void onLineBreak()
78    {
79  0 fListener.onTag(LINE_BREAK, EMPTY_MAP, EMPTY_MAP);
80    }
81   
 
82  0 toggle public void onNewLine()
83    {
84  0 fListener.onText(NEW_LINE);
85    }
86   
 
87  0 toggle public void onReference(String ref)
88    {
89  0 WikiReference r = new WikiReference(ref);
90  0 fListener.onTag(REF_IMPLICIT, tagParams(r), userParams(r));
91    }
92   
 
93  0 toggle public void onReference(WikiReference ref)
94    {
95  0 fListener.onTag(REF_IMPLICIT, tagParams(ref), userParams(ref));
96    }
97   
 
98  5 toggle public void onSpace(String str)
99    {
100  5 fListener.onText(str);
101    }
102   
 
103  0 toggle public void onSpecialSymbol(String str)
104    {
105    // fListener.beginTag(SPECIAL, EMPTY_MAP, EMPTY_MAP);
106  0 fListener.onText(str);
107    // fListener.endTag(SPECIAL, EMPTY_MAP, EMPTY_MAP);
108    }
109   
 
110  0 toggle public void onVerbatimInline(String str, WikiParameters params)
111    {
112  0 fListener.beginTag(VERBATIM_INLINE, EMPTY_MAP, userParams(params));
113  0 fListener.onCDATA(str);
114  0 fListener.endTag(VERBATIM_INLINE, EMPTY_MAP, userParams(params));
115    }
116   
 
117  15 toggle public void onWord(String str)
118    {
119  15 fListener.onText(str);
120    }
121    }