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

Method endArray

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

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

()

Source from the content-addressed store, hash-verified

370 * @throws java.util.NoSuchElementException if serialization object stack is empty
371 */
372 public JsonOutput endArray() {
373 Node topOfStack = stack.getFirst();
374 if (!(topOfStack instanceof JsonCollection)) {
375 throw new JsonException("Attempt to close a json array, but not writing a json array");
376 }
377 stack.removeFirst();
378 indent = indent.substring(0, indent.length() - indentBy.length());
379
380 if (!topOfStack.isEmpty) {
381 rawAppend(lineSeparator);
382 rawAppend(indent);
383 } else {
384 rawAppend(indent);
385 }
386 rawAppend("]");
387 return this;
388 }
389
390 /**
391 * Serialize the specified Java object as a JSON value.<br>

Callers 1

resolveConverterMethod · 0.45

Calls 2

rawAppendMethod · 0.95
lengthMethod · 0.65

Tested by

no test coverage detected