public final class JsonSchemaHelper extends Object
JsonSchemaNode
s.Modifier and Type | Method and Description |
---|---|
static JsonPattern |
createPattern(NavigableJsonInputAdapter input,
JsonSchemaNode schemaNode,
JsonPathCursor path)
Creates a
JsonPattern for given query path. |
static JsonSchemaNode |
createSchema(com.fasterxml.jackson.core.JsonParser parser)
Creates a description out of a JsonValue.
|
static JsonValue |
findValueWithPattern(NavigableJsonInputAdapter input,
JsonSchemaNode schemaNode,
JsonPattern expectedPattern,
JsonPathCursor attributePath)
Extract the JsonValue that is stored in attributePath in input.
|
public static JsonPattern createPattern(NavigableJsonInputAdapter input, JsonSchemaNode schemaNode, JsonPathCursor path)
JsonPattern
for given query path. If the path
matches a terminal value in the schema, then the schema is
returned. Otherwise this method returns null. If given path
has "any", pattern is created only upto that part. The rest is
omitted.input
- a buffer containing the queried object.schemaNode
- the description of the given objectpath
- query pathIOException
public static JsonValue findValueWithPattern(NavigableJsonInputAdapter input, JsonSchemaNode schemaNode, JsonPattern expectedPattern, JsonPathCursor attributePath) throws IOException
null
NOTE: this method cannot handle patterns with "any" in it.input
- a byte array containing the target objectschemaNode
- valid schema description to the target
object. The behavior is undefined if
description does not match the actual
objectexpectedPattern
- this cannot contain "any"attributePath
- this cannot contain "any"IOException
public static JsonSchemaNode createSchema(com.fasterxml.jackson.core.JsonParser parser) throws IOException
parser
- IOException
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.