1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package com.xpn.xwiki.internal.filter

File XWikiDocumentFilterCollection.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
39
20
1
200
150
20
0.51
1.95
20
1

Classes

Class Line # Actions
XWikiDocumentFilterCollection 34 39 0% 20 0
1.0100%
 

Contributing tests

This file is covered by 47 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 com.xpn.xwiki.internal.filter;
21   
22    import java.io.InputStream;
23    import java.util.List;
24    import java.util.Locale;
25   
26    import org.xwiki.filter.FilterEventParameters;
27    import org.xwiki.filter.FilterException;
28   
29    /**
30    * Dispatch event to passed list of filters.
31    *
32    * @version $Id: ba0efa975e0a5f1044f9a1a36f44eb79963b2ca8 $
33    */
 
34    public class XWikiDocumentFilterCollection implements XWikiDocumentFilter
35    {
36    private final List<? extends XWikiDocumentFilter> filters;
37   
38    /**
39    * @param filters the filters to send events to
40    */
 
41  35606 toggle public XWikiDocumentFilterCollection(List<? extends XWikiDocumentFilter> filters)
42    {
43  35606 this.filters = filters;
44    }
45   
 
46  44 toggle @Override
47    public void beginWiki(String name, FilterEventParameters parameters) throws FilterException
48    {
49  44 for (XWikiDocumentFilter filter : filters) {
50  121 filter.beginWiki(name, parameters);
51    }
52    }
53   
 
54  44 toggle @Override
55    public void endWiki(String name, FilterEventParameters parameters) throws FilterException
56    {
57  44 for (XWikiDocumentFilter filter : filters) {
58  121 filter.endWiki(name, parameters);
59    }
60    }
61   
 
62  34564 toggle @Override
63    public void beginWikiSpace(String name, FilterEventParameters parameters) throws FilterException
64    {
65  34564 for (XWikiDocumentFilter filter : filters) {
66  95051 filter.beginWikiSpace(name, parameters);
67    }
68    }
69   
 
70  34564 toggle @Override
71    public void endWikiSpace(String name, FilterEventParameters parameters) throws FilterException
72    {
73  34564 for (XWikiDocumentFilter filter : filters) {
74  95051 filter.endWikiSpace(name, parameters);
75    }
76    }
77   
 
78  30624 toggle @Override
79    public void beginWikiDocument(String name, FilterEventParameters parameters) throws FilterException
80    {
81  30624 for (XWikiDocumentFilter filter : filters) {
82  84216 filter.beginWikiDocument(name, parameters);
83    }
84    }
85   
 
86  30624 toggle @Override
87    public void endWikiDocument(String name, FilterEventParameters parameters) throws FilterException
88    {
89  30624 for (XWikiDocumentFilter filter : filters) {
90  84216 filter.endWikiDocument(name, parameters);
91    }
92    }
93   
 
94  30608 toggle @Override
95    public void beginWikiDocumentLocale(Locale locale, FilterEventParameters parameters) throws FilterException
96    {
97  30608 for (XWikiDocumentFilter filter : filters) {
98  84172 filter.beginWikiDocumentLocale(locale, parameters);
99    }
100    }
101   
 
102  30608 toggle @Override
103    public void endWikiDocumentLocale(Locale locale, FilterEventParameters parameters) throws FilterException
104    {
105  30608 for (XWikiDocumentFilter filter : filters) {
106  84172 filter.endWikiDocumentLocale(locale, parameters);
107    }
108    }
109   
 
110  30608 toggle @Override
111    public void beginWikiDocumentRevision(String revision, FilterEventParameters parameters) throws FilterException
112    {
113  30608 for (XWikiDocumentFilter filter : filters) {
114  84172 filter.beginWikiDocumentRevision(revision, parameters);
115    }
116    }
117   
 
118  30608 toggle @Override
119    public void endWikiDocumentRevision(String revision, FilterEventParameters parameters) throws FilterException
120    {
121  30608 for (XWikiDocumentFilter filter : filters) {
122  84172 filter.endWikiDocumentRevision(revision, parameters);
123    }
124    }
125   
 
126  4128 toggle @Override
127    public void onWikiAttachment(String name, InputStream content, Long size, FilterEventParameters parameters)
128    throws FilterException
129    {
130  4128 for (XWikiDocumentFilter filter : filters) {
131  11352 filter.onWikiAttachment(name, content, size, parameters);
132    }
133    }
134   
 
135  37202 toggle @Override
136    public void beginWikiClass(FilterEventParameters parameters) throws FilterException
137    {
138  37202 for (XWikiDocumentFilter filter : filters) {
139  98557 filter.beginWikiClass(parameters);
140    }
141    }
142   
 
143  37202 toggle @Override
144    public void endWikiClass(FilterEventParameters parameters) throws FilterException
145    {
146  37202 for (XWikiDocumentFilter filter : filters) {
147  98557 filter.endWikiClass(parameters);
148    }
149    }
150   
 
151  232862 toggle @Override
152    public void beginWikiClassProperty(String name, String type, FilterEventParameters parameters)
153    throws FilterException
154    {
155  232862 for (XWikiDocumentFilter filter : filters) {
156  608987 filter.beginWikiClassProperty(name, type, parameters);
157    }
158    }
159   
 
160  232862 toggle @Override
161    public void endWikiClassProperty(String name, String type, FilterEventParameters parameters) throws FilterException
162    {
163  232862 for (XWikiDocumentFilter filter : filters) {
164  608989 filter.endWikiClassProperty(name, type, parameters);
165    }
166    }
167   
 
168  2286539 toggle @Override
169    public void onWikiClassPropertyField(String name, String value, FilterEventParameters parameters)
170    throws FilterException
171    {
172  2286537 for (XWikiDocumentFilter filter : filters) {
173  5990261 filter.onWikiClassPropertyField(name, value, parameters);
174    }
175    }
176   
 
177  29480 toggle @Override
178    public void beginWikiObject(String name, FilterEventParameters parameters) throws FilterException
179    {
180  29480 for (XWikiDocumentFilter filter : filters) {
181  81070 filter.beginWikiObject(name, parameters);
182    }
183    }
184   
 
185  29480 toggle @Override
186    public void endWikiObject(String name, FilterEventParameters parameters) throws FilterException
187    {
188  29480 for (XWikiDocumentFilter filter : filters) {
189  81070 filter.endWikiObject(name, parameters);
190    }
191    }
192   
 
193  159464 toggle @Override
194    public void onWikiObjectProperty(String name, Object value, FilterEventParameters parameters) throws FilterException
195    {
196  159464 for (XWikiDocumentFilter filter : filters) {
197  438526 filter.onWikiObjectProperty(name, value, parameters);
198    }
199    }
200    }