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.BaseProperty; |
24 |
|
|
25 |
|
|
26 |
|
@link |
27 |
|
|
28 |
|
@version |
29 |
|
|
|
|
| 44.8% |
Uncovered Elements: 16 (29) |
Complexity: 10 |
Complexity Density: 0.62 |
|
30 |
|
public class Property extends Element |
31 |
|
{ |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@param@link |
36 |
|
@param |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
38 |
65238 |
public Property(BaseProperty property, XWikiContext context)... |
39 |
|
{ |
40 |
65239 |
super(property, context); |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
@return@link |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
130372 |
protected BaseProperty getBaseProperty()... |
47 |
|
{ |
48 |
130376 |
return (BaseProperty) this.element; |
49 |
|
} |
50 |
|
|
51 |
|
|
52 |
|
@return@link |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
54 |
0 |
public BaseProperty getProperty()... |
55 |
|
{ |
56 |
0 |
if (hasProgrammingRights()) { |
57 |
0 |
return (BaseProperty) this.element; |
58 |
|
} else { |
59 |
0 |
return null; |
60 |
|
} |
61 |
|
} |
62 |
|
|
63 |
|
|
64 |
|
@return |
65 |
|
@since |
66 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
67 |
0 |
public PropertyClass getPropertyClass()... |
68 |
|
{ |
69 |
0 |
BaseProperty baseProperty = getBaseProperty(); |
70 |
|
|
71 |
0 |
com.xpn.xwiki.objects.classes.PropertyClass propertyClass = baseProperty.getPropertyClass(getXWikiContext()); |
72 |
|
|
73 |
0 |
if (propertyClass != null) { |
74 |
0 |
return new PropertyClass(propertyClass, getXWikiContext()); |
75 |
|
} |
76 |
|
|
77 |
0 |
return null; |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
@return |
82 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
83 |
65190 |
public java.lang.Object getValue()... |
84 |
|
{ |
85 |
65188 |
BaseProperty baseProperty = getBaseProperty(); |
86 |
|
|
87 |
65188 |
com.xpn.xwiki.objects.classes.PropertyClass propertyClass = baseProperty.getPropertyClass(getXWikiContext()); |
88 |
|
|
89 |
|
|
90 |
|
|
91 |
65189 |
if (propertyClass != null && "Password".equals(propertyClass.getClassType())) { |
92 |
2 |
if (!getXWikiContext().getWiki().getRightService().hasProgrammingRights(getXWikiContext())) { |
93 |
0 |
return null; |
94 |
|
} |
95 |
|
} |
96 |
|
|
97 |
65186 |
return getBaseProperty().getValue(); |
98 |
|
} |
99 |
|
} |