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

File ProxyContentHandlerBlockParser.java

 

Coverage histogram

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

Code metrics

0
15
14
1
136
84
14
0.93
1.07
14
1

Classes

Class Line # Actions
ProxyContentHandlerBlockParser 37 15 0% 14 29
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.xml.internal.parser;
21   
22    import org.xml.sax.Attributes;
23    import org.xml.sax.Locator;
24    import org.xml.sax.SAXException;
25    import org.xwiki.rendering.block.XDOM;
26    import org.xwiki.rendering.internal.parser.XDOMGeneratorListener;
27    import org.xwiki.rendering.parser.xml.ContentHandlerBlockParser;
28    import org.xwiki.rendering.parser.xml.ContentHandlerStreamParser;
29    import org.xwiki.rendering.syntax.Syntax;
30   
31    /**
32    * Proxy parser which is using stream parser to produce XDOM.
33    *
34    * @version $Id: 2653e56aa1889472dd902bf366796da97d87ce80 $
35    * @since 5.2M1
36    */
 
37    public class ProxyContentHandlerBlockParser implements ContentHandlerBlockParser
38    {
39    /**
40    * The actual parser.
41    */
42    private ContentHandlerStreamParser parser;
43   
44    /**
45    * The proxy listener which produce the XDOM.
46    */
47    private XDOMGeneratorListener listener;
48   
49    /**
50    * @param parser the actual parser
51    * @param listener the listener which produce the XDOM
52    */
 
53  0 toggle public ProxyContentHandlerBlockParser(ContentHandlerStreamParser parser, XDOMGeneratorListener listener)
54    {
55  0 this.parser = parser;
56  0 this.listener = listener;
57    }
58   
 
59  0 toggle @Override
60    public void setDocumentLocator(Locator locator)
61    {
62  0 this.parser.setDocumentLocator(locator);
63    }
64   
 
65  0 toggle @Override
66    public void startDocument() throws SAXException
67    {
68  0 this.parser.startDocument();
69    }
70   
 
71  0 toggle @Override
72    public void endDocument() throws SAXException
73    {
74  0 this.parser.endDocument();
75    }
76   
 
77  0 toggle @Override
78    public void startPrefixMapping(String prefix, String uri) throws SAXException
79    {
80  0 this.parser.startPrefixMapping(prefix, uri);
81    }
82   
 
83  0 toggle @Override
84    public void endPrefixMapping(String prefix) throws SAXException
85    {
86  0 this.parser.endPrefixMapping(prefix);
87    }
88   
 
89  0 toggle @Override
90    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
91    {
92  0 this.parser.startElement(uri, localName, qName, atts);
93    }
94   
 
95  0 toggle @Override
96    public void endElement(String uri, String localName, String qName) throws SAXException
97    {
98  0 this.parser.endElement(uri, localName, qName);
99    }
100   
 
101  0 toggle @Override
102    public void characters(char[] ch, int start, int length) throws SAXException
103    {
104  0 this.parser.characters(ch, start, length);
105    }
106   
 
107  0 toggle @Override
108    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
109    {
110  0 this.parser.ignorableWhitespace(ch, start, length);
111    }
112   
 
113  0 toggle @Override
114    public void processingInstruction(String target, String data) throws SAXException
115    {
116  0 this.parser.processingInstruction(target, data);
117    }
118   
 
119  0 toggle @Override
120    public void skippedEntity(String name) throws SAXException
121    {
122  0 this.parser.skippedEntity(name);
123    }
124   
 
125  0 toggle @Override
126    public Syntax getSyntax()
127    {
128  0 return this.parser.getSyntax();
129    }
130   
 
131  0 toggle @Override
132    public XDOM getXDOM()
133    {
134  0 return this.listener.getXDOM();
135    }
136    }