com.github.fge.jsonschema.core.keyword.syntax.checkers.helpers
Class DependenciesSyntaxChecker

java.lang.Object
  extended by com.github.fge.jsonschema.core.keyword.syntax.checkers.AbstractSyntaxChecker
      extended by com.github.fge.jsonschema.core.keyword.syntax.checkers.helpers.DependenciesSyntaxChecker
All Implemented Interfaces:
SyntaxChecker
Direct Known Subclasses:
DraftV3DependenciesSyntaxChecker, DraftV4DependenciesSyntaxChecker

public abstract class DependenciesSyntaxChecker
extends AbstractSyntaxChecker

Helper class for syntax checking of draft v4 and v3 dependencies

The validation check also fills the JSON Pointer list with the appropriate paths when schema dependencies are encountered.


Field Summary
protected  EnumSet<NodeType> dependencyTypes
          Valid types for one dependency value
protected static Equivalence<JsonNode> EQUIVALENCE
          JSON Schema equivalence
 
Fields inherited from class com.github.fge.jsonschema.core.keyword.syntax.checkers.AbstractSyntaxChecker
keyword
 
Constructor Summary
protected DependenciesSyntaxChecker(NodeType... depTypes)
          Protected constructor
 
Method Summary
protected abstract  void checkDependency(ProcessingReport report, MessageBundle bundle, String name, SchemaTree tree)
          Check one dependency which is not a schema dependency
protected  void checkValue(Collection<JsonPointer> pointers, MessageBundle bundle, ProcessingReport report, SchemaTree tree)
          Method which all syntax checkers extending this class must implement
 
Methods inherited from class com.github.fge.jsonschema.core.keyword.syntax.checkers.AbstractSyntaxChecker
checkSyntax, getNode, getValidTypes, newMsg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUIVALENCE

protected static final Equivalence<JsonNode> EQUIVALENCE
JSON Schema equivalence


dependencyTypes

protected final EnumSet<NodeType> dependencyTypes
Valid types for one dependency value

Constructor Detail

DependenciesSyntaxChecker

protected DependenciesSyntaxChecker(NodeType... depTypes)
Protected constructor

Parameters:
depTypes - valid types for one dependency value
Method Detail

checkValue

protected final void checkValue(Collection<JsonPointer> pointers,
                                MessageBundle bundle,
                                ProcessingReport report,
                                SchemaTree tree)
                         throws ProcessingException
Description copied from class: AbstractSyntaxChecker
Method which all syntax checkers extending this class must implement

At this point, it is known that the keyword's value has at least the correct type.

Specified by:
checkValue in class AbstractSyntaxChecker
Parameters:
pointers - the list of JSON Pointers to fill (see description)
bundle - the message bundle to use
report - the processing report to use
tree - the schema
Throws:
InvalidSchemaException - keyword is invalid
ProcessingException

checkDependency

protected abstract void checkDependency(ProcessingReport report,
                                        MessageBundle bundle,
                                        String name,
                                        SchemaTree tree)
                                 throws ProcessingException
Check one dependency which is not a schema dependency

Parameters:
report - the processing report to use
bundle - the message bundle to use
name - the property dependency name
tree - the schema
Throws:
InvalidSchemaException - keyword is invalid
ProcessingException