MCPcopy Index your code
hub / github.com/apache/groovy / valueOf

Method valueOf

src/main/java/groovy/namespace/QName.java:249–270  ·  view source on GitHub ↗

Returns a QName holding the value of the specified String. The string must be in the form returned by the QName.toString() method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}" part being optional. This method doesn't do a full validation of the resulting QName. In particular, it

(String s)

Source from the content-addressed store, hash-verified

247 * @return QName corresponding to the given String
248 */
249 public static QName valueOf(String s) {
250
251 if ((s == null) || s.isEmpty()) {
252 throw new IllegalArgumentException("invalid QName literal");
253 }
254
255 if (s.charAt(0) == '{') {
256 int i = s.indexOf('}');
257
258 if (i == -1) {
259 throw new IllegalArgumentException("invalid QName literal");
260 }
261
262 if (i == s.length() - 1) {
263 throw new IllegalArgumentException("invalid QName literal");
264 } else {
265 return new QName(s.substring(1, i), s.substring(i + 1));
266 }
267 } else {
268 return new QName(s);
269 }
270 }
271
272 /**
273 * Returns a hash code value for this QName object. The hash code

Callers 15

mainMethod · 0.45
TransformationMethod · 0.45
nextMethod · 0.45
extractMethod · 0.45
qrstMethod · 0.45
doCallMethod · 0.45
testTrampolineMethod · 0.45
testEqualsAndHashCodeMethod · 0.45
CharacterRangeTestClass · 0.45
createRangeMethod · 0.45
createValueMethod · 0.45
createRangeMethod · 0.45

Calls 5

substringMethod · 0.80
isEmptyMethod · 0.45
charAtMethod · 0.45
indexOfMethod · 0.45
lengthMethod · 0.45

Tested by 15

doCallMethod · 0.36
testTrampolineMethod · 0.36
testEqualsAndHashCodeMethod · 0.36
createRangeMethod · 0.36
createValueMethod · 0.36
createRangeMethod · 0.36
createValueMethod · 0.36
createRangeMethod · 0.36
createValueMethod · 0.36
testSizeWithLongToMethod · 0.36
checkRangeValuesMethod · 0.36
createRangeMethod · 0.36