Package com.networknt.schema
Class JsonSchemaFactory
- java.lang.Object
-
- com.networknt.schema.JsonSchemaFactory
-
public class JsonSchemaFactory extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonSchemaFactory.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static JsonSchemaFactory.Builderbuilder()Builder without keywords or formats.static JsonSchemaFactory.Builderbuilder(JsonSchemaFactory blueprint)static JsonSchemaVersioncheckVersion(SpecVersion.VersionFlag versionFlag)JsonSchemacreate(ValidationContext validationContext, SchemaLocation schemaLocation, JsonNodePath evaluationPath, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema)JsonSchemacreate(ValidationContext validationContext, SchemaLocation schemaLocation, JsonNodePath evaluationPath, URI currentUri, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema)protected ValidationContextcreateValidationContext(com.fasterxml.jackson.databind.JsonNode schemaNode, SchemaValidatorsConfig config)static JsonSchemaFactorygetInstance()Deprecated.This is a method that is kept to ensure backward compatible.static JsonSchemaFactorygetInstance(SpecVersion.VersionFlag versionFlag)protected JsonSchemagetMappedSchema(URI schemaUri, SchemaValidatorsConfig config, URI mappedUri)JsonSchemagetSchema(com.fasterxml.jackson.databind.JsonNode jsonNode)JsonSchemagetSchema(com.fasterxml.jackson.databind.JsonNode jsonNode, SchemaValidatorsConfig config)JsonSchemagetSchema(InputStream schemaStream)JsonSchemagetSchema(InputStream schemaStream, SchemaValidatorsConfig config)JsonSchemagetSchema(String schema)JsonSchemagetSchema(String schema, SchemaValidatorsConfig config)JsonSchemagetSchema(URI schemaUri)JsonSchemagetSchema(URI schemaUri, com.fasterxml.jackson.databind.JsonNode jsonNode)JsonSchemagetSchema(URI schemaUri, com.fasterxml.jackson.databind.JsonNode jsonNode, SchemaValidatorsConfig config)JsonSchemagetSchema(URI schemaUri, SchemaValidatorsConfig config)protected SchemaLocationgetSchemaLocation(URI schemaRetrievalUri, com.fasterxml.jackson.databind.JsonNode schemaNode, ValidationContext validationContext)Gets the schema location from the $id or retrieval uri.URIFactorygetUriFactory()URITranslatorgetUriTranslator()protected JsonSchemanewJsonSchema(URI schemaUri, com.fasterxml.jackson.databind.JsonNode schemaNode, SchemaValidatorsConfig config)protected static StringnormalizeMetaSchemaUri(String u)
-
-
-
Method Detail
-
builder
public static JsonSchemaFactory.Builder builder()
Builder without keywords or formats.JsonSchemaFactory.builder(JsonSchemaFactory.getDraftV4()).build();- Returns:
- a builder instance without any keywords or formats - usually not what one needs.
-
getInstance
@Deprecated public static JsonSchemaFactory getInstance()
Deprecated.This is a method that is kept to ensure backward compatible. You shouldn't use it anymore. Please specify the draft version when get an instance.- Returns:
- JsonSchemaFactory
-
getInstance
public static JsonSchemaFactory getInstance(SpecVersion.VersionFlag versionFlag)
-
checkVersion
public static JsonSchemaVersion checkVersion(SpecVersion.VersionFlag versionFlag)
-
builder
public static JsonSchemaFactory.Builder builder(JsonSchemaFactory blueprint)
-
newJsonSchema
protected JsonSchema newJsonSchema(URI schemaUri, com.fasterxml.jackson.databind.JsonNode schemaNode, SchemaValidatorsConfig config)
-
create
public JsonSchema create(ValidationContext validationContext, SchemaLocation schemaLocation, JsonNodePath evaluationPath, URI currentUri, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema)
-
create
public JsonSchema create(ValidationContext validationContext, SchemaLocation schemaLocation, JsonNodePath evaluationPath, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema)
-
getSchemaLocation
protected SchemaLocation getSchemaLocation(URI schemaRetrievalUri, com.fasterxml.jackson.databind.JsonNode schemaNode, ValidationContext validationContext)
Gets the schema location from the $id or retrieval uri.- Parameters:
schemaRetrievalUri- the schema retrieval urischemaNode- the schema jsonvalidationContext- the validationContext- Returns:
- the schema location
-
createValidationContext
protected ValidationContext createValidationContext(com.fasterxml.jackson.databind.JsonNode schemaNode, SchemaValidatorsConfig config)
-
getUriFactory
public URIFactory getUriFactory()
- Returns:
- A shared
URIfactory that is used for creating the URI references in schemas.
-
getUriTranslator
public URITranslator getUriTranslator()
-
getSchema
public JsonSchema getSchema(String schema, SchemaValidatorsConfig config)
-
getSchema
public JsonSchema getSchema(String schema)
-
getSchema
public JsonSchema getSchema(InputStream schemaStream, SchemaValidatorsConfig config)
-
getSchema
public JsonSchema getSchema(InputStream schemaStream)
-
getSchema
public JsonSchema getSchema(URI schemaUri, SchemaValidatorsConfig config)
-
getMappedSchema
protected JsonSchema getMappedSchema(URI schemaUri, SchemaValidatorsConfig config, URI mappedUri)
-
getSchema
public JsonSchema getSchema(URI schemaUri)
-
getSchema
public JsonSchema getSchema(URI schemaUri, com.fasterxml.jackson.databind.JsonNode jsonNode, SchemaValidatorsConfig config)
-
getSchema
public JsonSchema getSchema(com.fasterxml.jackson.databind.JsonNode jsonNode, SchemaValidatorsConfig config)
-
getSchema
public JsonSchema getSchema(URI schemaUri, com.fasterxml.jackson.databind.JsonNode jsonNode)
-
getSchema
public JsonSchema getSchema(com.fasterxml.jackson.databind.JsonNode jsonNode)
-
-