1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.api; |
21 |
|
|
22 |
|
import com.xpn.xwiki.XWikiContext; |
23 |
|
import com.xpn.xwiki.objects.BaseCollection; |
24 |
|
import com.xpn.xwiki.objects.BaseProperty; |
25 |
|
import com.xpn.xwiki.objects.PropertyInterface; |
26 |
|
|
|
|
| 85.4% |
Uncovered Elements: 6 (41) |
Complexity: 14 |
Complexity Density: 0.56 |
|
27 |
|
public abstract class Collection extends Element |
28 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
29 |
37187 |
public Collection(BaseCollection collection, XWikiContext context)... |
30 |
|
{ |
31 |
37188 |
super(collection, context); |
32 |
|
} |
33 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
34 |
198782 |
protected BaseCollection getCollection()... |
35 |
|
{ |
36 |
198785 |
return (BaseCollection) this.element; |
37 |
|
} |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
10817 |
public Class getxWikiClass()... |
40 |
|
{ |
41 |
10817 |
return new Class(getCollection().getXClass(getXWikiContext()), getXWikiContext()); |
42 |
|
} |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
49225 |
@Override... |
45 |
|
public String getName() |
46 |
|
{ |
47 |
49225 |
return getCollection().getName(); |
48 |
|
} |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
0 |
public String getPrettyName()... |
51 |
|
{ |
52 |
0 |
return getCollection().getPrettyName(); |
53 |
|
} |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
55 |
100329 |
public int getNumber()... |
56 |
|
{ |
57 |
100329 |
return getCollection().getNumber(); |
58 |
|
} |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
0 |
public java.lang.Object[] getPropertyNames()... |
61 |
|
{ |
62 |
0 |
return getCollection().getPropertyNames(); |
63 |
|
} |
64 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
65 |
7627 |
public Element[] getProperties()... |
66 |
|
{ |
67 |
7627 |
@SuppressWarnings("unchecked") |
68 |
|
java.util.Collection<BaseProperty> coll = getCollection().getFieldList(); |
69 |
7627 |
if (coll == null) { |
70 |
0 |
return null; |
71 |
|
} |
72 |
7627 |
Property[] properties = new Property[coll.size()]; |
73 |
7627 |
int i = 0; |
74 |
7627 |
for (BaseProperty prop : coll) { |
75 |
58910 |
properties[i++] = new Property(prop, getXWikiContext()); |
76 |
|
} |
77 |
7627 |
return properties; |
78 |
|
} |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
80 |
10518 |
public Property getProperty(String name)... |
81 |
|
{ |
82 |
10517 |
try { |
83 |
10518 |
PropertyInterface prop = getCollection().get(name); |
84 |
10515 |
if (prop == null) { |
85 |
4201 |
return null; |
86 |
|
} |
87 |
|
|
88 |
6313 |
return new Property((BaseProperty) prop, getXWikiContext()); |
89 |
|
} catch (Exception e) { |
90 |
2 |
return null; |
91 |
|
} |
92 |
|
} |
93 |
|
|
94 |
|
|
95 |
|
@param |
96 |
|
@return |
97 |
|
@since |
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
99 |
5523 |
public java.lang.Object getValue(String name)... |
100 |
|
{ |
101 |
5523 |
Property property = getProperty(name); |
102 |
5523 |
if (property != null) { |
103 |
4252 |
return property.getValue(); |
104 |
|
} |
105 |
|
|
106 |
1270 |
return null; |
107 |
|
} |
108 |
|
} |