1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.lesscss.internal.resources; |
21 |
|
|
22 |
|
import org.xwiki.bridge.DocumentAccessBridge; |
23 |
|
import org.xwiki.lesscss.compiler.LESSCompilerException; |
24 |
|
import org.xwiki.lesscss.resources.LESSResourceReference; |
25 |
|
import org.xwiki.model.reference.EntityReferenceSerializer; |
26 |
|
import org.xwiki.model.reference.ObjectPropertyReference; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
@since |
32 |
|
@version |
33 |
|
|
|
|
| 58.8% |
Uncovered Elements: 7 (17) |
Complexity: 6 |
Complexity Density: 0.6 |
|
34 |
|
public class LESSObjectPropertyResourceReference implements LESSResourceReference |
35 |
|
{ |
36 |
|
private ObjectPropertyReference objectPropertyReference; |
37 |
|
|
38 |
|
private EntityReferenceSerializer<String> entityReferenceSerializer; |
39 |
|
|
40 |
|
private DocumentAccessBridge bridge; |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
@param |
46 |
|
@param |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
48 |
5 |
public LESSObjectPropertyResourceReference(ObjectPropertyReference objectPropertyReference, ... |
49 |
|
EntityReferenceSerializer<String> entityReferenceSerializer, |
50 |
|
DocumentAccessBridge bridge) |
51 |
|
{ |
52 |
5 |
this.objectPropertyReference = objectPropertyReference; |
53 |
5 |
this.entityReferenceSerializer = entityReferenceSerializer; |
54 |
5 |
this.bridge = bridge; |
55 |
|
} |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
57 |
0 |
@Override... |
58 |
|
public boolean equals(Object o) |
59 |
|
{ |
60 |
0 |
if (o instanceof LESSObjectPropertyResourceReference) { |
61 |
0 |
LESSObjectPropertyResourceReference lessObjectPropertyResourceReference = |
62 |
|
(LESSObjectPropertyResourceReference) o; |
63 |
0 |
return objectPropertyReference.equals(lessObjectPropertyResourceReference.objectPropertyReference); |
64 |
|
} |
65 |
|
|
66 |
0 |
return false; |
67 |
|
} |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
4 |
@Override... |
70 |
|
public int hashCode() |
71 |
|
{ |
72 |
4 |
return objectPropertyReference.hashCode(); |
73 |
|
} |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
2 |
@Override... |
76 |
|
public String getContent(String skin) throws LESSCompilerException |
77 |
|
{ |
78 |
2 |
return (String) bridge.getProperty(objectPropertyReference); |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
4 |
@Override... |
82 |
|
public String serialize() |
83 |
|
{ |
84 |
4 |
return String.format("LessXObjectProperty[%s]", entityReferenceSerializer.serialize(objectPropertyReference)); |
85 |
|
} |
86 |
|
} |