public interface JsonSchema
Modifier and Type | Method and Description |
---|---|
JsonSchema |
annotate(String key,
String value)
Annotates the schema.
|
boolean |
containsKey(String key)
Checks if the given key is present in the schema object.
|
Set<String> |
fieldNames()
Returns the field names on the underlying object.
|
<R> R |
get(String key)
Get a type casted value by key.
|
<R> R |
get(String key,
R fallback)
Get a type casted value by key.
|
static JsonSchema |
of(boolean bool)
Factory method to create a
JsonSchema from a Boolean . |
static JsonSchema |
of(JsonObject json)
Factory method to create a
JsonSchema from a JsonObject . |
static JsonSchema |
of(String id,
JsonObject json)
Factory method to create a
JsonSchema from a JsonObject . |
JsonObject |
resolve()
Tries to resolve all internal references.
|
static JsonSchema of(JsonObject json)
JsonSchema
from a JsonObject
.json
- a JSON Object.static JsonSchema of(String id, JsonObject json)
JsonSchema
from a JsonObject
.id
- will force the given id as the schema $id.json
- a JSON Object.static JsonSchema of(boolean bool)
JsonSchema
from a Boolean
.bool
- a boolean.JsonSchema annotate(String key, String value)
key
- a keyvalue
- a value<R> R get(String key)
key
- a keynull
<R> R get(String key, R fallback)
key
- a keyfallback
- fallback when key is not presentnull
boolean containsKey(String key)
key
- a keytrue
if presentSet<String> fieldNames()
JsonObject resolve()
JsonObject
representing the schema with $ref
s replaced by their value.SchemaException
- when the resolution is impossible. One of such cases is circular referencing.Copyright © 2023 Eclipse. All rights reserved.