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

File JspWikiSerializer.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
83% of files have more coverage

Code metrics

14
44
66
1
451
279
73
1.66
0.67
66
1.11

Classes

Class Line # Actions
JspWikiSerializer 33 44 0% 73 124
0.00%
 

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    package org.xwiki.rendering.wikimodel.jspwiki;
21   
22    import org.xwiki.rendering.wikimodel.IWemListener;
23    import org.xwiki.rendering.wikimodel.WikiFormat;
24    import org.xwiki.rendering.wikimodel.WikiParameters;
25    import org.xwiki.rendering.wikimodel.WikiReference;
26   
27    /**
28    * Not ready yet.
29    *
30    * @version $Id: 1e4be8cc7e0385b5d0dffcd59629c79f248819ef $
31    * @since 4.0M1
32    */
 
33    public class JspWikiSerializer implements IWemListener
34    {
35    private StringBuffer fBuffer;
36   
 
37  0 toggle public JspWikiSerializer()
38    {
39   
40    }
41   
 
42  0 toggle public JspWikiSerializer(StringBuffer buf)
43    {
44  0 fBuffer = buf;
45    }
46   
 
47  0 toggle public void beginDefinitionDescription()
48    {
49    // TODO Auto-generated method stub
50   
51    }
52   
 
53  0 toggle public void beginDefinitionList(WikiParameters params)
54    {
55    // TODO Auto-generated method stub
56   
57    }
58   
 
59  0 toggle public void beginDefinitionTerm()
60    {
61    // TODO Auto-generated method stub
62   
63    }
64   
 
65  0 toggle public void beginDocument()
66    {
67    // TODO Auto-generated method stub
68   
69    }
70   
 
71  0 toggle public void beginDocument(WikiParameters params)
72    {
73    // TODO Auto-generated method stub
74   
75    }
76   
 
77  0 toggle public void beginFormat(WikiFormat format)
78    {
79    // TODO Auto-generated method stub
80   
81    }
82   
 
83  0 toggle public void beginHeader(int headerLevel, WikiParameters params)
84    {
85  0 println(getEol());
86  0 for (int i = 0; i < headerLevel; i++) {
87  0 print("!");
88    }
89  0 print(" ");
90    }
91   
 
92  0 toggle public void beginInfoBlock(String infoType, WikiParameters params)
93    {
94    // TODO Auto-generated method stub
95   
96    }
97   
 
98  0 toggle public void beginList(WikiParameters params, boolean ordered)
99    {
100    // TODO Auto-generated method stub
101   
102    }
103   
 
104  0 toggle public void beginListItem()
105    {
106  0 print("* ");
107    }
108   
 
109  0 toggle public void beginParagraph(WikiParameters params)
110    {
111    // TODO Auto-generated method stub
112   
113    }
114   
 
115  0 toggle public void beginPropertyBlock(String propertyUri, boolean doc)
116    {
117    // TODO Auto-generated method stub
118   
119    }
120   
 
121  0 toggle public void beginPropertyInline(String str)
122    {
123    // TODO Auto-generated method stub
124   
125    }
126   
 
127  0 toggle public void beginQuotation(WikiParameters params)
128    {
129    // TODO Auto-generated method stub
130   
131    }
132   
 
133  0 toggle public void beginQuotationLine()
134    {
135    // TODO Auto-generated method stub
136   
137    }
138   
 
139  0 toggle public void beginSection(
140    int docLevel,
141    int headerLevel,
142    WikiParameters params)
143    {
144    // TODO Auto-generated method stub
145   
146    }
147   
 
148  0 toggle public void beginSectionContent(
149    int docLevel,
150    int headerLevel,
151    WikiParameters params)
152    {
153    // TODO Auto-generated method stub
154   
155    }
156   
 
157  0 toggle public void beginTable(WikiParameters params)
158    {
159    }
160   
 
161  0 toggle public void beginTableCell(boolean tableHead, WikiParameters params)
162    {
163  0 if (tableHead) {
164  0 print("||");
165    } else {
166  0 print("|");
167    }
168    }
169   
 
170  0 toggle public void beginTableRow(WikiParameters params)
171    {
172  0 println("");
173    }
174   
 
175  0 toggle public void endDefinitionDescription()
176    {
177    // TODO Auto-generated method stub
178   
179    }
180   
 
181  0 toggle public void endDefinitionList(WikiParameters params)
182    {
183    // TODO Auto-generated method stub
184   
185    }
186   
 
187  0 toggle public void endDefinitionTerm()
188    {
189    // TODO Auto-generated method stub
190   
191    }
192   
 
193  0 toggle public void endDocument()
194    {
195    // TODO Auto-generated method stub
196   
197    }
198   
 
199  0 toggle public void endDocument(WikiParameters params)
200    {
201    // TODO Auto-generated method stub
202   
203    }
204   
 
205  0 toggle public void endFormat(WikiFormat format)
206    {
207    // TODO Auto-generated method stub
208   
209    }
210   
 
211  0 toggle public void endHeader(int headerLevel, WikiParameters params)
212    {
213  0 println("");
214  0 println("");
215    }
216   
 
217  0 toggle public void endInfoBlock(String infoType, WikiParameters params)
218    {
219    // TODO Auto-generated method stub
220   
221    }
222   
 
223  0 toggle public void endList(WikiParameters params, boolean ordered)
224    {
225    // TODO Auto-generated method stub
226   
227    }
228   
 
229  0 toggle public void endListItem()
230    {
231  0 println("");
232    }
233   
 
234  0 toggle public void endParagraph(WikiParameters params)
235    {
236    // TODO Auto-generated method stub
237   
238    }
239   
 
240  0 toggle public void endPropertyBlock(String propertyUri, boolean doc)
241    {
242    // TODO Auto-generated method stub
243   
244    }
245   
 
246  0 toggle public void endPropertyInline(String inlineProperty)
247    {
248    // TODO Auto-generated method stub
249   
250    }
251   
 
252  0 toggle public void endQuotation(WikiParameters params)
253    {
254    // TODO Auto-generated method stub
255   
256    }
257   
 
258  0 toggle public void endQuotationLine()
259    {
260    // TODO Auto-generated method stub
261   
262    }
263   
 
264  0 toggle public void endSection(int docLevel, int headerLevel, WikiParameters params)
265    {
266    // TODO Auto-generated method stub
267   
268    }
269   
 
270  0 toggle public void endSectionContent(
271    int docLevel,
272    int headerLevel,
273    WikiParameters params)
274    {
275    // TODO Auto-generated method stub
276   
277    }
278   
 
279  0 toggle public void endTable(WikiParameters params)
280    {
281    }
282   
 
283  0 toggle public void endTableCell(boolean tableHead, WikiParameters params)
284    {
285  0 if (tableHead) {
286  0 print("||");
287    } else {
288  0 print("|");
289    }
290    }
291   
 
292  0 toggle public void endTableRow(WikiParameters params)
293    {
294  0 println("");
295    }
296   
 
297  0 toggle protected String getEol()
298    {
299  0 return "\n";
300    }
301   
 
302  0 toggle public void onEmptyLines(int count)
303    {
304    // TODO Auto-generated method stub
305   
306    }
307   
 
308  0 toggle public void onEscape(String str)
309    {
310    // TODO Auto-generated method stub
311   
312    }
313   
 
314  0 toggle public void onExtensionBlock(String extensionName, WikiParameters params)
315    {
316    // TODO Auto-generated method stub
317   
318    }
319   
 
320  0 toggle public void onExtensionInline(String extensionName, WikiParameters params)
321    {
322    // TODO Auto-generated method stub
323   
324    }
325   
 
326  0 toggle public void onHorizontalLine(WikiParameters params)
327    {
328  0 println("----");
329    }
330   
 
331  0 toggle public void onImage(String ref)
332    {
333    // TODO Auto-generated method stub
334   
335    }
336   
 
337  0 toggle public void onImage(WikiReference ref)
338    {
339    // TODO Auto-generated method stub
340   
341    }
342   
 
343  0 toggle public void onLineBreak()
344    {
345  0 println("");
346  0 println("");
347    }
348   
 
349  0 toggle public void onMacro(String macroName, WikiParameters params, String content)
350    {
351    // TODO Auto-generated method stub
352   
353    }
354   
 
355  0 toggle public void onMacroBlock(
356    String macroName,
357    WikiParameters params,
358    String content)
359    {
360    // TODO Auto-generated method stub
361   
362    }
363   
 
364  0 toggle public void onMacroInline(
365    String macroName,
366    WikiParameters params,
367    String content)
368    {
369    // TODO Auto-generated method stub
370   
371    }
372   
 
373  0 toggle public void onNewLine()
374    {
375  0 println("");
376    }
377   
 
378  0 toggle public void onReference(String ref)
379    {
380  0 onReference(ref, null);
381    }
382   
 
383  0 toggle private void onReference(String link, String label)
384    {
385  0 link = link.replaceAll(" ", "_");
386  0 if (link.indexOf("Image") == 0) {
387  0 print("{image" + link.substring(5) + "}");
388    } else {
389  0 if (label != null) {
390  0 print("[" + label + ">" + link + "]");
391    } else {
392  0 print("[" + link + "]");
393    }
394    }
395    }
396   
 
397  0 toggle public void onReference(WikiReference ref)
398    {
399  0 onReference(ref.getLink(), ref.getLabel());
400    }
401   
 
402  0 toggle public void onSpace(String str)
403    {
404  0 print(str);
405    }
406   
 
407  0 toggle public void onSpecialSymbol(String str)
408    {
409  0 print(str);
410    }
411   
 
412  0 toggle public void onTableCaption(String str)
413    {
414  0 println(str);
415    }
416   
 
417  0 toggle public void onVerbatimBlock(String str, WikiParameters params)
418    {
419  0 print("{{{" + str + "}}}");
420    }
421   
 
422  0 toggle public void onVerbatimInline(String str, WikiParameters params)
423    {
424  0 println("{{{" + str + "}}}");
425    }
426   
 
427  0 toggle public void onWord(String str)
428    {
429  0 print(str);
430    }
431   
 
432  0 toggle protected void print(String str)
433    {
434  0 if (fBuffer != null) {
435  0 fBuffer.append(str);
436    } else {
437  0 System.out.print(str);
438    }
439    }
440   
 
441  0 toggle protected void println(String str)
442    {
443  0 if (fBuffer != null) {
444  0 fBuffer.append(str);
445  0 String eol = getEol();
446  0 fBuffer.append(eol);
447    } else {
448  0 System.out.println(str);
449    }
450    }
451    }