1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.rest.delivery.jcr.filter; |
35 |
|
|
36 |
|
import info.magnolia.jcr.iterator.FilteringRangeIterator; |
37 |
|
import info.magnolia.jcr.wrapper.ChildFilteringContentDecorator; |
38 |
|
|
39 |
|
import java.util.Collection; |
40 |
|
|
41 |
|
import javax.jcr.Node; |
42 |
|
import javax.jcr.NodeIterator; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
|
|
| 86.7% |
Uncovered Elements: 2 (15) |
Complexity: 6 |
Complexity Density: 0.67 |
|
47 |
|
public class ChildNodeTypesFilteringNodeIterator extends FilteringRangeIterator<Node> implements NodeIterator { |
48 |
|
|
49 |
|
private final Collection<String> primaryNodeTypes; |
50 |
|
private final boolean evaluateSupertypes; |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
12 |
public ChildNodeTypesFilteringNodeIterator(NodeIterator nodeIterator, Collection<String> primaryNodeTypes) {... |
53 |
12 |
this (nodeIterator, primaryNodeTypes, true); |
54 |
|
} |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
56 |
12 |
public ChildNodeTypesFilteringNodeIterator(NodeIterator nodeIterator, Collection<String> primaryNodeTypes, boolean evaluateSupertypes) {... |
57 |
12 |
super(nodeIterator); |
58 |
12 |
this.primaryNodeTypes = primaryNodeTypes; |
59 |
12 |
this.evaluateSupertypes = evaluateSupertypes; |
60 |
|
} |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
18 |
@Override... |
63 |
|
public Node next() { |
64 |
18 |
return wrapNode(super.next()); |
65 |
|
} |
66 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
0 |
@Override... |
68 |
|
public Node nextNode() { |
69 |
0 |
return wrapNode(super.next()); |
70 |
|
} |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
18 |
@Override... |
73 |
|
protected boolean evaluate(Node node) { |
74 |
18 |
return true; |
75 |
|
} |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
77 |
18 |
protected Node wrapNode(Node node) {... |
78 |
18 |
ChildFilteringContentDecorator depthDecorator = new ChildFilteringContentDecorator(new NodeTypesPredicate(primaryNodeTypes, evaluateSupertypes), true); |
79 |
18 |
return depthDecorator.wrapNode(node); |
80 |
|
} |
81 |
|
} |