1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.query.xwql.internal.hql; |
21 |
|
|
22 |
|
import org.xwiki.query.xwql.internal.QueryContext; |
23 |
|
import org.xwiki.query.xwql.internal.QueryContext.ObjectInfo; |
24 |
|
import org.xwiki.query.xwql.internal.QueryContext.PropertyInfo; |
25 |
|
import org.xwiki.bridge.DocumentAccessBridge; |
26 |
|
|
|
|
| 89.5% |
Uncovered Elements: 2 (19) |
Complexity: 6 |
Complexity Density: 0.46 |
|
27 |
|
public class Printer |
28 |
|
{ |
29 |
|
QueryContext context; |
30 |
|
|
31 |
|
XWQLtoHQLTranslator parent; |
32 |
|
|
33 |
|
ObjectPrinter objectPrinter = new ObjectPrinter(); |
34 |
|
|
35 |
|
PropertyPrinter propertyPrinter = new PropertyPrinter(); |
36 |
|
|
37 |
|
StringBuilder from = new StringBuilder(); |
38 |
|
|
39 |
|
StringBuilder where = new StringBuilder(); |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
41 |
1032 |
public Printer(QueryContext context, XWQLtoHQLTranslator parent)... |
42 |
|
{ |
43 |
1032 |
this.context = context; |
44 |
1032 |
this.parent = parent; |
45 |
|
} |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
113 |
QueryContext getContext()... |
48 |
|
{ |
49 |
113 |
return context; |
50 |
|
} |
51 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
0 |
DocumentAccessBridge getAccessBridge()... |
53 |
|
{ |
54 |
0 |
return parent.getDocumentAccessBridge(); |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
396 |
public ObjectPrinter getObjectPrinter()... |
58 |
|
{ |
59 |
396 |
return objectPrinter; |
60 |
|
} |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
149 |
public PropertyPrinter getPropertyPrinter()... |
63 |
|
{ |
64 |
149 |
return propertyPrinter; |
65 |
|
} |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
67 |
1032 |
String print() throws Exception... |
68 |
|
{ |
69 |
1032 |
for (ObjectInfo obj : context.getObjects()) { |
70 |
396 |
getObjectPrinter().print(obj, this); |
71 |
396 |
for (PropertyInfo prop : obj.properties.values()) { |
72 |
149 |
getPropertyPrinter().print(prop, this); |
73 |
|
} |
74 |
|
} |
75 |
1032 |
TreePrinter treePrinter = new TreePrinter(this); |
76 |
1032 |
context.getTree().apply(treePrinter); |
77 |
1032 |
return treePrinter.toString(); |
78 |
|
} |
79 |
|
} |