com.github.fge.jsonschema.processors.syntax
Class SyntaxValidator

java.lang.Object
  extended by com.github.fge.jsonschema.processors.syntax.SyntaxValidator

public final class SyntaxValidator
extends Object

Standalone syntax validator

This is the syntax validator built, and returned, by JsonSchemaFactory.getSyntaxValidator(). It can be used to validate schemas independently of the validation chain. Among other features, it detects $schema and acts accordingly.

Note that the reports used are always ListProcessingReports.


Constructor Summary
SyntaxValidator(ValidationConfiguration cfg)
          Constructor
 
Method Summary
 Processor<ValueHolder<SchemaTree>,ValueHolder<SchemaTree>> getProcessor()
          Return the underlying processor
 boolean schemaIsValid(JsonNode schema)
          Tell whether a schema is valid
 ProcessingReport validateSchema(JsonNode schema)
          Validate a schema and return a report
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyntaxValidator

public SyntaxValidator(ValidationConfiguration cfg)
Constructor

Parameters:
cfg - the validation configuration to use
Method Detail

schemaIsValid

public boolean schemaIsValid(JsonNode schema)
Tell whether a schema is valid

Parameters:
schema - the schema
Returns:
true if the schema is valid

validateSchema

public ProcessingReport validateSchema(JsonNode schema)
Validate a schema and return a report

Parameters:
schema - the schema
Returns:
a report

getProcessor

public Processor<ValueHolder<SchemaTree>,ValueHolder<SchemaTree>> getProcessor()
Return the underlying processor

You can use this processor to chain it with your own.

Returns:
a processor performing full syntax validation