1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.internal.plugin.rightsmanager

File ReferenceUserIterator.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

0
4
4
1
102
34
4
1
1
4
1

Classes

Class Line # Actions
ReferenceUserIterator 38 4 0% 4 2
0.7575%
 

Contributing tests

This file is covered by 22 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.plugin.rightsmanager;
21   
22    import java.util.List;
23   
24    import org.xwiki.context.Execution;
25    import org.xwiki.model.reference.DocumentReference;
26    import org.xwiki.model.reference.DocumentReferenceResolver;
27   
28    import com.xpn.xwiki.XWikiContext;
29   
30    /**
31    * Iterates over all the users found in the passed references (which can be references to groups or to users) and
32    * return {@link DocumentReference} for each found user.
33    *
34    * @version $Id: 4d5cff3fd358b11338cafa2afe4febe6f4dd88d2 $
35    * @since 6.4.2
36    * @since 7.0M2
37    */
 
38    public class ReferenceUserIterator extends UserIterator<DocumentReference>
39    {
40    /**
41    * Recommended if this iterator is called from code using components.
42    *
43    * @param userAndGroupReferences the list of references (users or groups) to iterate over
44    * @param excludedUserAndGroupReferences the list of references (users or groups) to exclude. Can be null.
45    * @param explicitDocumentReferenceResolver the resolver to use for transforming group member strings into
46    * {@link DocumentReference}
47    * @param execution the component used to access the {@link XWikiContext} we use to call oldcore APIs
48    */
 
49  2 toggle public ReferenceUserIterator(List<DocumentReference> userAndGroupReferences,
50    List<DocumentReference> excludedUserAndGroupReferences,
51    DocumentReferenceResolver<String> explicitDocumentReferenceResolver, Execution execution)
52    {
53  2 super(userAndGroupReferences, excludedUserAndGroupReferences, new ReferenceUserDataExtractor(),
54    explicitDocumentReferenceResolver, execution);
55    }
56   
57    /**
58    * Recommended if this iterator is called from code using components.
59    *
60    * @param userOrGroupReference the reference (user or group) to iterate over
61    * @param explicitDocumentReferenceResolver the resolver to use for transforming group member strings into
62    * {@link DocumentReference}
63    * @param execution the component used to access the {@link XWikiContext} we use to call oldcore APIs
64    */
 
65  19 toggle public ReferenceUserIterator(DocumentReference userOrGroupReference,
66    DocumentReferenceResolver<String> explicitDocumentReferenceResolver, Execution execution)
67    {
68  19 super(userOrGroupReference, new ReferenceUserDataExtractor(), explicitDocumentReferenceResolver, execution);
69    }
70   
71    /**
72    * Recommended if this iterator is called from old code not using components.
73    *
74    * @param userAndGroupReferences the list of references (users or groups) to iterate over
75    * @param excludedUserAndGroupReferences the list of references (users or groups) to exclude. Can be null.
76    * @param explicitDocumentReferenceResolver the resolver to use for transforming group member strings into
77    * {@link DocumentReference}
78    * @param xwikiContext the {@link XWikiContext} we use to call oldcore APIs
79    */
 
80  0 toggle public ReferenceUserIterator(List<DocumentReference> userAndGroupReferences,
81    List<DocumentReference> excludedUserAndGroupReferences,
82    DocumentReferenceResolver<String> explicitDocumentReferenceResolver, XWikiContext xwikiContext)
83    {
84  0 super(userAndGroupReferences, excludedUserAndGroupReferences, new ReferenceUserDataExtractor(),
85    explicitDocumentReferenceResolver, xwikiContext);
86    }
87   
88    /**
89    * Recommended if this iterator is called from old code not using components.
90    *
91    * @param userOrGroupReference the reference (user or group) to iterate over
92    * @param explicitDocumentReferenceResolver the resolver to use for transforming group member strings into
93    * {@link DocumentReference}
94    * @param xwikiContext the {@link XWikiContext} we use to call oldcore APIs
95    */
 
96  9 toggle public ReferenceUserIterator(DocumentReference userOrGroupReference,
97    DocumentReferenceResolver<String> explicitDocumentReferenceResolver, XWikiContext xwikiContext)
98    {
99  9 super(userOrGroupReference, new ReferenceUserDataExtractor(), explicitDocumentReferenceResolver,
100    xwikiContext);
101    }
102    }