| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.rendering.wikimodel; |
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
@version |
| 36 |
|
@since |
| 37 |
|
|
| |
|
| 0% |
Uncovered Elements: 50 (50) |
Complexity: 16 |
Complexity Density: 0.59 |
|
| 38 |
|
public class WikiMacro |
| 39 |
|
{ |
| 40 |
|
public final static String MACRO_TOC = "toc"; |
| 41 |
|
|
| 42 |
|
public final static String MACRO_NOTOC = "notoc"; |
| 43 |
|
|
| 44 |
|
public final static String MACRO_FORCETOC = "forcetoc"; |
| 45 |
|
|
| 46 |
|
public final static String MACRO_FOOTNOTES = "footnotes"; |
| 47 |
|
|
| 48 |
|
public final static String UNHANDLED_MACRO = "unhandled"; |
| 49 |
|
|
| 50 |
|
private final String name; |
| 51 |
|
|
| 52 |
|
private final WikiParameters wikiParameters; |
| 53 |
|
|
| 54 |
|
private final String content; |
| 55 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 56 |
0 |
public WikiMacro(String name)... |
| 57 |
|
{ |
| 58 |
0 |
this(name, WikiParameters.EMPTY, null); |
| 59 |
|
} |
| 60 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 61 |
0 |
public WikiMacro(String name, WikiParameters wikiParameters)... |
| 62 |
|
{ |
| 63 |
0 |
this(name, wikiParameters, null); |
| 64 |
|
} |
| 65 |
|
|
| |
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 66 |
0 |
public WikiMacro(String name, WikiParameters wikiParameters, String content)... |
| 67 |
|
{ |
| 68 |
0 |
super(); |
| 69 |
0 |
this.name = name; |
| 70 |
0 |
this.content = content; |
| 71 |
0 |
this.wikiParameters = wikiParameters; |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
@return |
| 76 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
0 |
public String getName()... |
| 78 |
|
{ |
| 79 |
0 |
return name; |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
|
| 83 |
|
@return |
| 84 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 85 |
0 |
public String getContent()... |
| 86 |
|
{ |
| 87 |
0 |
return content; |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
|
| 91 |
|
@return |
| 92 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 93 |
0 |
public WikiParameters getWikiParameters()... |
| 94 |
|
{ |
| 95 |
0 |
return wikiParameters; |
| 96 |
|
} |
| 97 |
|
|
| |
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 98 |
0 |
@Override... |
| 99 |
|
public int hashCode() |
| 100 |
|
{ |
| 101 |
0 |
final int prime = 31; |
| 102 |
0 |
int result = 1; |
| 103 |
0 |
result = prime * result + ((name == null) ? 0 : name.hashCode()); |
| 104 |
0 |
return result; |
| 105 |
|
} |
| 106 |
|
|
| |
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 7 |
Complexity Density: 0.54 |
|
| 107 |
0 |
@Override... |
| 108 |
|
public boolean equals(Object obj) |
| 109 |
|
{ |
| 110 |
0 |
if (this == obj) { |
| 111 |
0 |
return true; |
| 112 |
|
} |
| 113 |
0 |
if (obj == null) { |
| 114 |
0 |
return false; |
| 115 |
|
} |
| 116 |
0 |
if (getClass() != obj.getClass()) { |
| 117 |
0 |
return false; |
| 118 |
|
} |
| 119 |
0 |
WikiMacro other = (WikiMacro) obj; |
| 120 |
0 |
if (name == null) { |
| 121 |
0 |
if (other.name != null) { |
| 122 |
0 |
return false; |
| 123 |
|
} |
| 124 |
0 |
} else if (!name.equals(other.name)) { |
| 125 |
0 |
return false; |
| 126 |
|
} |
| 127 |
0 |
return true; |
| 128 |
|
} |
| 129 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 130 |
0 |
@Override... |
| 131 |
|
public String toString() |
| 132 |
|
{ |
| 133 |
0 |
return "{{" + name + " | " + content + " | " + wikiParameters + "}}"; |
| 134 |
|
} |
| 135 |
|
} |