com.github.fge.jsonschema.main
Class JsonValidator

java.lang.Object
  extended by com.github.fge.jsonschema.main.JsonValidator

@Immutable
public final class JsonValidator
extends Object

A generic schema/instance validator

One such instance exists per JsonSchemaFactory. In fact, you have to go through a factory to obtain an instance.

This class is also responsible for building JsonSchema instances.

See Also:
JsonSchemaFactory.getValidator()

Method Summary
 ProcessingReport validate(JsonNode schema, JsonNode instance)
          Validate a schema/instance pair
 ProcessingReport validateUnchecked(JsonNode schema, JsonNode instance)
          Validate a schema/instance pair (unchecked mode)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

validate

public ProcessingReport validate(JsonNode schema,
                                 JsonNode instance)
                          throws ProcessingException
Validate a schema/instance pair

Parameters:
schema - the schema
instance - the instance
Returns:
a validation report
Throws:
ProcessingException - an exception occurred during validation
ProcessingError - the schema or instance is null

validateUnchecked

public ProcessingReport validateUnchecked(JsonNode schema,
                                          JsonNode instance)
Validate a schema/instance pair (unchecked mode)

The same warnings as described in JsonSchema.validateUnchecked(JsonNode) apply

Parameters:
schema - the schema
instance - the instance
Returns:
a validation report
Throws:
ProcessingError - the schema or instance is null


Copyright © 2014. All Rights Reserved.