Clover Coverage Report - XWiki Rendering - Parent POM 4.0-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Mar 12 2012 18:03:13 CET
../../../../../../img/srcFileCovDistChart8.png 68% of files have more coverage
25   136   22   2.08
20   95   0.88   12
12     1.83  
1    
 
  DefaultXMLFilter       Line # 36 25 0% 22 16 71.9% 0.71929824
 
  (219)
 
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.xhtml.filter;
21   
22    import java.io.IOException;
23   
24    import org.xml.sax.InputSource;
25    import org.xml.sax.SAXException;
26    import org.xml.sax.SAXNotRecognizedException;
27    import org.xml.sax.SAXNotSupportedException;
28    import org.xml.sax.XMLReader;
29    import org.xml.sax.ext.LexicalHandler;
30    import org.xml.sax.helpers.XMLFilterImpl;
31   
32    /**
33    * @version $Id: 80e77fa4bc9af59aed59a43667fb70dcdeb2f22c $
34    * @since 4.0M1
35    */
 
36    public class DefaultXMLFilter extends XMLFilterImpl implements LexicalHandler
37    {
38    public static final String SAX_LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler";
39   
40    private LexicalHandler lexicalHandler;
41   
 
42  2 toggle public DefaultXMLFilter()
43    {
44  2 super();
45    }
46   
 
47  929 toggle public DefaultXMLFilter(XMLReader reader)
48    {
49  929 super(reader);
50    }
51   
 
52  963 toggle @Override
53    public void parse(InputSource input) throws SAXException, IOException
54    {
55  963 if (getParent() != null) {
56  963 getParent().setProperty(SAX_LEXICAL_HANDLER_PROPERTY, this);
57    }
58  963 super.parse(input);
59    }
60   
 
61  929 toggle @Override
62    public void setProperty(String name, Object value)
63    throws SAXNotRecognizedException,
64    SAXNotSupportedException
65    {
66    // We save the lexical handler so that we can use it in the
67    // implementation of the LexicalHandler interface methods.
68  929 if (SAX_LEXICAL_HANDLER_PROPERTY.equals(name)) {
69  929 this.lexicalHandler = (LexicalHandler) value;
70    } else {
71  0 super.setProperty(name, value);
72    }
73    }
74   
 
75  0 toggle @Override
76    public Object getProperty(String name)
77    throws SAXNotRecognizedException,
78    SAXNotSupportedException
79    {
80  0 if (SAX_LEXICAL_HANDLER_PROPERTY.equals(name)) {
81  0 return this.lexicalHandler;
82    } else {
83  0 return super.getProperty(name);
84    }
85    }
86   
 
87  628 toggle public void comment(char[] ch, int start, int length) throws SAXException
88    {
89  628 if (this.lexicalHandler != null) {
90  628 this.lexicalHandler.comment(ch, start, length);
91    }
92    }
93   
 
94  15 toggle public void endCDATA() throws SAXException
95    {
96  15 if (this.lexicalHandler != null) {
97  15 this.lexicalHandler.endCDATA();
98    }
99    }
100   
 
101  657 toggle public void endDTD() throws SAXException
102    {
103  657 if (this.lexicalHandler != null) {
104  657 this.lexicalHandler.endDTD();
105    }
106    }
107   
 
108  11280 toggle public void endEntity(String name) throws SAXException
109    {
110  11280 if (this.lexicalHandler != null) {
111  11280 this.lexicalHandler.endEntity(name);
112    }
113    }
114   
 
115  15 toggle public void startCDATA() throws SAXException
116    {
117  15 if (this.lexicalHandler != null) {
118  15 this.lexicalHandler.startCDATA();
119    }
120    }
121   
 
122  657 toggle public void startDTD(String name, String publicId, String systemId)
123    throws SAXException
124    {
125  657 if (this.lexicalHandler != null) {
126  657 this.lexicalHandler.startDTD(name, publicId, systemId);
127    }
128    }
129   
 
130  11280 toggle public void startEntity(String name) throws SAXException
131    {
132  11280 if (this.lexicalHandler != null) {
133  11280 this.lexicalHandler.startEntity(name);
134    }
135    }
136    }