MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / endObject

Method endObject

java/src/org/openqa/selenium/json/JsonOutput.java:324–338  ·  view source on GitHub ↗

End the current JSON object. @return this JsonOutput object @throws JsonException if top item on serialization object stack isn't a JsonObject @throws java.util.NoSuchElementException if serialization object stack is empty

()

Source from the content-addressed store, hash-verified

322 * @throws java.util.NoSuchElementException if serialization object stack is empty
323 */
324 public JsonOutput endObject() {
325 Node topOfStack = stack.getFirst();
326 if (!(topOfStack instanceof JsonObject)) {
327 throw new JsonException("Attempt to close a json object, but not writing a json object");
328 }
329 stack.removeFirst();
330 indent = indent.substring(0, indent.length() - indentBy.length());
331
332 if (topOfStack.isEmpty) {
333 appender.accept(indent + "}");
334 } else {
335 appender.accept(lineSeparator + indent + "}");
336 }
337 return this;
338 }
339
340 /**
341 * Begin a new JSON array.

Callers 2

JsonOutputMethod · 0.95
mapObjectMethod · 0.95

Calls 2

lengthMethod · 0.65
acceptMethod · 0.65

Tested by

no test coverage detected