1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.model.reference; |
21 |
|
|
22 |
|
import org.xwiki.model.EntityType; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@version |
28 |
|
@since |
29 |
|
|
|
|
| 63% |
Uncovered Elements: 10 (27) |
Complexity: 11 |
Complexity Density: 0.79 |
|
30 |
|
public class ClassPropertyReference extends EntityReference |
31 |
|
{ |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@param |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
38 |
15 |
public ClassPropertyReference(EntityReference reference)... |
39 |
|
{ |
40 |
15 |
super(reference); |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
@param |
47 |
|
@param |
48 |
|
@param |
49 |
|
@since |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
0 |
protected ClassPropertyReference(EntityReference reference, EntityReference oldReference,... |
52 |
|
EntityReference newReference) |
53 |
|
{ |
54 |
0 |
super(reference, oldReference, newReference); |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
@param |
61 |
|
@param |
62 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
63 |
8642 |
public ClassPropertyReference(String propertyName, DocumentReference classReference)... |
64 |
|
{ |
65 |
8642 |
super(propertyName, EntityType.CLASS_PROPERTY, classReference); |
66 |
|
} |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
@param |
71 |
|
@param |
72 |
|
@param |
73 |
|
@param |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
@Deprecated... |
76 |
|
public ClassPropertyReference(String wiki, String space, String page, String propertyName) |
77 |
|
{ |
78 |
0 |
this(propertyName, new DocumentReference(wiki, space, page)); |
79 |
|
} |
80 |
|
|
81 |
|
|
82 |
|
@inheritDoc |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
@see |
87 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
88 |
8657 |
@Override... |
89 |
|
protected void setType(EntityType type) |
90 |
|
{ |
91 |
8657 |
if (type != EntityType.CLASS_PROPERTY) { |
92 |
0 |
throw new IllegalArgumentException("Invalid type [" + type + "] for an class property reference"); |
93 |
|
} |
94 |
|
|
95 |
8657 |
super.setType(EntityType.CLASS_PROPERTY); |
96 |
|
} |
97 |
|
|
98 |
|
|
99 |
|
@inheritDoc |
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
@see |
105 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
106 |
8657 |
@Override... |
107 |
|
protected void setParent(EntityReference parent) |
108 |
|
{ |
109 |
8657 |
if (parent instanceof DocumentReference) { |
110 |
8643 |
super.setParent(parent); |
111 |
8643 |
return; |
112 |
|
} |
113 |
|
|
114 |
14 |
if (parent == null || parent.getType() != EntityType.DOCUMENT) { |
115 |
0 |
throw new IllegalArgumentException("Invalid parent reference [" + parent + "] for an class property " |
116 |
|
+ "reference"); |
117 |
|
} |
118 |
|
|
119 |
14 |
super.setParent(new DocumentReference(parent)); |
120 |
|
} |
121 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
122 |
0 |
@Override... |
123 |
|
public ClassPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent) |
124 |
|
{ |
125 |
0 |
return new ClassPropertyReference(this, oldParent, newParent); |
126 |
|
} |
127 |
|
} |