Debian Codegraph @

src/main/org/h2/util/json/JSONValue.java

raw
1 /*
2 * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (https://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6 package org.h2.util.json;
7
8 /**
9 * JSON value.
10 */
11 public abstract class JSONValue {
12
13 JSONValue() {
14 }
15
16 /**
17 * Appends this value to the specified target.
18 *
19 * @param target
20 * the target
21 */
22 public abstract void addTo(JSONTarget<?> target);
23
24 @Override
25 public final String toString() {
26 JSONStringTarget target = new JSONStringTarget();
27 addTo(target);
28 return target.getResult();
29 }
30
31 }