| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
package org.kuali.student.common.assembly.data; |
| 20 |
|
|
| 21 |
|
import java.util.ArrayList; |
| 22 |
|
import java.util.Collection; |
| 23 |
|
|
| 24 |
|
import org.kuali.student.common.assembly.data.Data.Key; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
@author |
| 30 |
|
|
| 31 |
|
|
|
|
|
| 0% |
Uncovered Elements: 60 (60) |
Complexity: 20 |
Complexity Density: 0.54 |
|
| 32 |
|
public class QueryPath extends ArrayList<Key> { |
| 33 |
|
|
| 34 |
|
private static final PathParser parser = new DefaultPathParser(); |
| 35 |
|
|
| 36 |
|
private static final long serialVersionUID = 1L; |
| 37 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
0
|
public static String getWildCard() {... |
| 39 |
0
|
return parser.getWildCard(); |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 42 |
0
|
public static String getPathSeparator(){... |
| 43 |
0
|
return parser.getPathSeparator(); |
| 44 |
|
} |
| 45 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 46 |
0
|
public static QueryPath parse(final String path) {... |
| 47 |
0
|
return parser.parse(path); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
private String stringPath = null; |
| 51 |
|
|
| 52 |
|
|
| 53 |
|
@see |
| 54 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 55 |
0
|
@Override... |
| 56 |
|
public void add(final int index, final Key element) { |
| 57 |
0
|
stringPath = null; |
| 58 |
0
|
super.add(index, element); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
@see |
| 63 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 64 |
0
|
@Override... |
| 65 |
|
public boolean add(final Key e) { |
| 66 |
0
|
stringPath = null; |
| 67 |
0
|
return super.add(e); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
@see |
| 72 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 73 |
0
|
@Override... |
| 74 |
|
public boolean addAll(final Collection<? extends Key> c) { |
| 75 |
0
|
stringPath = null; |
| 76 |
0
|
return super.addAll(c); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
|
| 80 |
|
@see |
| 81 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 82 |
0
|
@Override... |
| 83 |
|
public boolean addAll(final int index, final Collection<? extends Key> c) { |
| 84 |
0
|
stringPath = null; |
| 85 |
0
|
return super.addAll(index, c); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
|
| 89 |
|
@see |
| 90 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 91 |
0
|
@Override... |
| 92 |
|
public void clear() { |
| 93 |
0
|
stringPath = null; |
| 94 |
0
|
super.clear(); |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
|
| 98 |
|
@see |
| 99 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 100 |
0
|
@Override... |
| 101 |
|
public Key remove(final int index) { |
| 102 |
0
|
stringPath = null; |
| 103 |
0
|
return super.remove(index); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
|
| 107 |
|
@see |
| 108 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 109 |
0
|
@Override... |
| 110 |
|
public boolean remove(final Object o) { |
| 111 |
0
|
stringPath = null; |
| 112 |
0
|
return super.remove(o); |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
|
| 116 |
|
@see |
| 117 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 118 |
0
|
@Override... |
| 119 |
|
public boolean removeAll(final Collection<?> c) { |
| 120 |
0
|
stringPath = null; |
| 121 |
0
|
return super.removeAll(c); |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
|
| 125 |
|
@see |
| 126 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 127 |
0
|
@Override... |
| 128 |
|
protected void removeRange(final int fromIndex, final int toIndex) { |
| 129 |
0
|
stringPath = null; |
| 130 |
0
|
super.removeRange(fromIndex, toIndex); |
| 131 |
|
} |
| 132 |
|
|
| 133 |
|
|
| 134 |
|
@see |
| 135 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 136 |
0
|
@Override... |
| 137 |
|
public boolean retainAll(final Collection<?> c) { |
| 138 |
0
|
stringPath = null; |
| 139 |
0
|
return super.retainAll(c); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
|
| 143 |
|
@see |
| 144 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 145 |
0
|
@Override... |
| 146 |
|
public Key set(final int index, final Key element) { |
| 147 |
0
|
stringPath = null; |
| 148 |
0
|
return super.set(index, element); |
| 149 |
|
} |
| 150 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 151 |
0
|
public QueryPath subPath(final int fromIndex, final int toIndex) {... |
| 152 |
|
|
| 153 |
0
|
final QueryPath result = new QueryPath(); |
| 154 |
0
|
for (int i = fromIndex; i < toIndex; i++) { |
| 155 |
0
|
result.add(this.get(i)); |
| 156 |
|
} |
| 157 |
0
|
return result; |
| 158 |
|
} |
| 159 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 160 |
0
|
@Override... |
| 161 |
|
public String toString() { |
| 162 |
0
|
if (stringPath == null) { |
| 163 |
0
|
stringPath = parser.format(this); |
| 164 |
|
} |
| 165 |
0
|
return stringPath; |
| 166 |
|
} |
| 167 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 168 |
0
|
public static QueryPath concat(String... paths) {... |
| 169 |
0
|
QueryPath result = new QueryPath(); |
| 170 |
0
|
for (String path : paths) { |
| 171 |
0
|
if (path != null) { |
| 172 |
0
|
result.addAll(QueryPath.parse(path)); |
| 173 |
|
} |
| 174 |
|
} |
| 175 |
0
|
return result; |
| 176 |
|
} |
| 177 |
|
} |