MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / write0

Method write0

java/src/org/openqa/selenium/json/JsonOutput.java:415–435  ·  view source on GitHub ↗
(@Nullable Object input, int maxDepth, int depthRemaining)

Source from the content-addressed store, hash-verified

413 }
414
415 private JsonOutput write0(@Nullable Object input, int maxDepth, int depthRemaining) {
416 if (input == null) {
417 append("null");
418 return this;
419 }
420
421 // Fast paths for the classes that dominate real payloads, mirroring the corresponding
422 // converters and skipping the per-class strategy lookup.
423 Class<?> cls = input.getClass();
424 if (cls == String.class) {
425 writeString(input);
426 } else if (cls == Long.class || cls == Integer.class || cls == Double.class) {
427 append(input.toString());
428 } else if (cls == Boolean.class) {
429 append((Boolean) input ? "true" : "false");
430 } else {
431 CONVERTERS.get(cls).consume(this, input, maxDepth, depthRemaining);
432 }
433
434 return this;
435 }
436
437 /**
438 * {@inheritDoc}

Callers 4

writeMethod · 0.95
convertUsingMethodMethod · 0.95
mapObjectMethod · 0.95
resolveConverterMethod · 0.80

Calls 6

appendMethod · 0.95
writeStringMethod · 0.95
getClassMethod · 0.65
toStringMethod · 0.65
consumeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected