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

File AbstractXMLBeanOutputFilterStreamFactory.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

0
4
2
1
59
28
3
0.75
2
2
1.5

Classes

Class Line # Actions
AbstractXMLBeanOutputFilterStreamFactory 39 4 0% 3 1
0.833333383.3%
 

Contributing tests

This file is covered by 24 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.filter.xml.internal.output;
21   
22    import javax.xml.stream.FactoryConfigurationError;
23    import javax.xml.stream.XMLStreamException;
24    import javax.xml.transform.Result;
25   
26    import org.xwiki.filter.FilterException;
27    import org.xwiki.filter.output.AbstractBeanOutputFilterStreamFactory;
28    import org.xwiki.filter.output.BeanOutputFilterStream;
29    import org.xwiki.filter.type.FilterStreamType;
30    import org.xwiki.filter.xml.output.XMLOutputProperties;
31   
32    /**
33    * A generic xml output filter implementation. This class can be used as a test bench to validate various XMLInputStream
34    * wiki parsers.
35    *
36    * @version $Id: 80644ce1078cc9af5a528e0f8b1a1ebdbcdb261a $
37    * @since 6.2M1
38    */
 
39    public abstract class AbstractXMLBeanOutputFilterStreamFactory<P extends XMLOutputProperties, F> extends
40    AbstractBeanOutputFilterStreamFactory<P, F>
41    {
 
42  25 toggle public AbstractXMLBeanOutputFilterStreamFactory(FilterStreamType type)
43    {
44  25 super(type);
45    }
46   
 
47  25 toggle @Override
48    public BeanOutputFilterStream<P> createOutputFilterStream(P properties) throws FilterException
49    {
50  25 try {
51  25 return new DefaultXMLOutputFilterStream<P, F>(this, properties);
52    } catch (Exception e) {
53  0 throw new FilterException("Failed to create output filter stream", e);
54    }
55    }
56   
57    protected abstract Object createListener(Result result, P parameters) throws XMLStreamException,
58    FactoryConfigurationError, FilterException;
59    }