| 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.XWikiException; |
| 24 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
| 25 |
|
import com.xpn.xwiki.objects.BaseObject; |
| 26 |
|
import com.xpn.xwiki.objects.BaseObjectReference; |
| 27 |
|
|
| |
|
| 48.9% |
Uncovered Elements: 23 (45) |
Complexity: 16 |
Complexity Density: 0.59 |
|
| 28 |
|
public class Object extends Collection |
| 29 |
|
{ |
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 30 |
7401 |
public Object(BaseObject obj, XWikiContext context)... |
| 31 |
|
{ |
| 32 |
7401 |
super(obj, context); |
| 33 |
|
} |
| 34 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 35 |
3776 |
protected BaseObject getBaseObject()... |
| 36 |
|
{ |
| 37 |
3776 |
return (BaseObject) getCollection(); |
| 38 |
|
} |
| 39 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 40 |
0 |
public BaseObject getXWikiObject()... |
| 41 |
|
{ |
| 42 |
0 |
if (hasProgrammingRights()) { |
| 43 |
0 |
return (BaseObject) getCollection(); |
| 44 |
|
} else { |
| 45 |
0 |
return null; |
| 46 |
|
} |
| 47 |
|
} |
| 48 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
0 |
public String getGuid()... |
| 50 |
|
{ |
| 51 |
0 |
return getBaseObject().getGuid(); |
| 52 |
|
} |
| 53 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 54 |
0 |
public void setGuid(String guid)... |
| 55 |
|
{ |
| 56 |
0 |
getBaseObject().setGuid(guid); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
@link |
| 62 |
|
|
| 63 |
|
|
| |
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
| 64 |
214 |
public java.lang.Object get(String name)... |
| 65 |
|
{ |
| 66 |
214 |
try { |
| 67 |
214 |
XWikiDocument doc = getBaseObject().getOwnerDocument(); |
| 68 |
214 |
if (doc == null) { |
| 69 |
0 |
doc = |
| 70 |
|
getXWikiContext().getWiki().getDocument(getBaseObject().getDocumentReference(), getXWikiContext()); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
214 |
return doc.display(name, this.getBaseObject(), getXWikiContext()); |
| 74 |
|
} catch (XWikiException e) { |
| 75 |
0 |
return null; |
| 76 |
|
} |
| 77 |
|
} |
| 78 |
|
|
| |
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
| 79 |
9 |
public java.lang.Object display(String name, String mode)... |
| 80 |
|
{ |
| 81 |
9 |
try { |
| 82 |
9 |
XWikiDocument doc = getBaseObject().getOwnerDocument(); |
| 83 |
9 |
if (doc == null) { |
| 84 |
0 |
doc = |
| 85 |
|
getXWikiContext().getWiki().getDocument(getBaseObject().getDocumentReference(), getXWikiContext()); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
9 |
return doc.display(name, mode, this.getBaseObject(), getXWikiContext()); |
| 89 |
|
} catch (XWikiException e) { |
| 90 |
0 |
return null; |
| 91 |
|
} |
| 92 |
|
} |
| 93 |
|
|
| |
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 94 |
0 |
@Override... |
| 95 |
|
public boolean equals(java.lang.Object arg0) |
| 96 |
|
{ |
| 97 |
0 |
if (!(arg0 instanceof Object)) { |
| 98 |
0 |
return false; |
| 99 |
|
} |
| 100 |
0 |
Object o = (Object) arg0; |
| 101 |
0 |
return o.getXWikiContext().equals(getXWikiContext()) && this.element.equals(o.element); |
| 102 |
|
} |
| 103 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 104 |
488 |
public void set(String fieldname, java.lang.Object value)... |
| 105 |
|
{ |
| 106 |
488 |
XWikiContext xcontext = getXWikiContext(); |
| 107 |
|
|
| 108 |
488 |
getBaseObject().set(fieldname, value, xcontext); |
| 109 |
|
|
| 110 |
|
|
| 111 |
488 |
getBaseObject().getOwnerDocument().setAuthorReference(xcontext.getAuthorReference()); |
| 112 |
|
} |
| 113 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 114 |
220 |
@Override... |
| 115 |
|
public BaseObjectReference getReference() |
| 116 |
|
{ |
| 117 |
220 |
return getBaseObject().getReference(); |
| 118 |
|
} |
| 119 |
|
} |