public class DefaultJsonSchemaValidator extends java.lang.Object implements JsonSchemaValidator
JsonSchemaValidator interface. This class
provides methods to validate structured content against a JSON schema. It uses the
NetworkNT JSON Schema Validator library for validation.JsonSchemaValidator.ValidationResponse| 构造器和说明 |
|---|
DefaultJsonSchemaValidator() |
DefaultJsonSchemaValidator(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearCache()
Clears the schema cache.
|
protected java.lang.String |
generateCacheKey(java.util.Map<java.lang.String,java.lang.Object> schema)
Generates a cache key for the given schema map.
|
int |
getCacheSize()
Returns the current size of the schema cache.
|
JsonSchemaValidator.ValidationResponse |
validate(java.util.Map<java.lang.String,java.lang.Object> schema,
java.lang.Object structuredContent)
Validates the structured content against the provided JSON schema.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDefault, getDefaultpublic DefaultJsonSchemaValidator()
public DefaultJsonSchemaValidator(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public JsonSchemaValidator.ValidationResponse validate(java.util.Map<java.lang.String,java.lang.Object> schema, java.lang.Object structuredContent)
JsonSchemaValidatorvalidate 在接口中 JsonSchemaValidatorschema - The JSON schema to validate against.structuredContent - The structured content to validate.protected java.lang.String generateCacheKey(java.util.Map<java.lang.String,java.lang.Object> schema)
schema - the schema mappublic void clearCache()
public int getCacheSize()