GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator > Class Template Reference#
JSON Schema Validator. More...
#include <schema.h>

Public Types | |
typedef SchemaDocumentType::SchemaType | SchemaType |
typedef SchemaDocumentType::PointerType | PointerType |
typedef SchemaType::EncodingType | EncodingType |
typedef SchemaType::SValue | SValue |
typedef EncodingType::Ch | Ch |
typedef GenericStringRef< Ch > | StringRefType |
typedef GenericValue< EncodingType, StateAllocator > | ValueType |
![]() | |
typedef SchemaType::Ch | Ch |
typedef SchemaType::SValue | SValue |
Public Member Functions | |
GenericSchemaValidator (const SchemaDocumentType &schemaDocument, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity) | |
Constructor without output handler. More... | |
GenericSchemaValidator (const SchemaDocumentType &schemaDocument, OutputHandler &outputHandler, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity) | |
Constructor with output handler. More... | |
~GenericSchemaValidator () | |
Destructor. More... | |
void | Reset () |
Reset the internal states. More... | |
void | ResetError () |
Reset the error state. More... | |
void | SetValidateFlags (unsigned flags) |
Implementation of ISchemaValidator. More... | |
virtual unsigned | GetValidateFlags () const |
virtual bool | IsValid () const |
ValueType & | GetError () |
End of Implementation of ISchemaValidator. More... | |
const ValueType & | GetError () const |
PointerType | GetInvalidSchemaPointer () const |
Gets the JSON pointer pointed to the invalid schema. More... | |
const Ch * | GetInvalidSchemaKeyword () const |
Gets the keyword of invalid schema. More... | |
ValidateErrorCode | GetInvalidSchemaCode () const |
Gets the error code of invalid schema. More... | |
PointerType | GetInvalidDocumentPointer () const |
Gets the JSON pointer pointed to the invalid value. More... | |
void | NotMultipleOf (int64_t actual, const SValue &expected) |
void | NotMultipleOf (uint64_t actual, const SValue &expected) |
void | NotMultipleOf (double actual, const SValue &expected) |
void | AboveMaximum (int64_t actual, const SValue &expected, bool exclusive) |
void | AboveMaximum (uint64_t actual, const SValue &expected, bool exclusive) |
void | AboveMaximum (double actual, const SValue &expected, bool exclusive) |
void | BelowMinimum (int64_t actual, const SValue &expected, bool exclusive) |
void | BelowMinimum (uint64_t actual, const SValue &expected, bool exclusive) |
void | BelowMinimum (double actual, const SValue &expected, bool exclusive) |
void | TooLong (const Ch *str, SizeType length, SizeType expected) |
void | TooShort (const Ch *str, SizeType length, SizeType expected) |
void | DoesNotMatch (const Ch *str, SizeType length) |
void | DisallowedItem (SizeType index) |
void | TooFewItems (SizeType actualCount, SizeType expectedCount) |
void | TooManyItems (SizeType actualCount, SizeType expectedCount) |
void | DuplicateItems (SizeType index1, SizeType index2) |
void | TooManyProperties (SizeType actualCount, SizeType expectedCount) |
void | TooFewProperties (SizeType actualCount, SizeType expectedCount) |
void | StartMissingProperties () |
void | AddMissingProperty (const SValue &name) |
bool | EndMissingProperties () |
void | PropertyViolations (ISchemaValidator **subvalidators, SizeType count) |
void | DisallowedProperty (const Ch *name, SizeType length) |
void | StartDependencyErrors () |
void | StartMissingDependentProperties () |
void | AddMissingDependentProperty (const SValue &targetName) |
void | EndMissingDependentProperties (const SValue &sourceName) |
void | AddDependencySchemaError (const SValue &sourceName, ISchemaValidator *subvalidator) |
bool | EndDependencyErrors () |
void | DisallowedValue (const ValidateErrorCode code=kValidateErrorEnum) |
void | StartDisallowedType () |
void | AddExpectedType (const typename SchemaType::ValueType &expectedType) |
void | EndDisallowedType (const typename SchemaType::ValueType &actualType) |
void | NotAllOf (ISchemaValidator **subvalidators, SizeType count) |
void | NoneOf (ISchemaValidator **subvalidators, SizeType count) |
void | NotOneOf (ISchemaValidator **subvalidators, SizeType count) |
void | MultipleOneOf (SizeType index1, SizeType index2) |
void | Disallowed () |
void | DisallowedWhenWriting () |
void | DisallowedWhenReading () |
bool | Null () |
bool | Bool (bool b) |
bool | Int (int i) |
bool | Uint (unsigned u) |
bool | Int64 (int64_t i) |
bool | Uint64 (uint64_t u) |
bool | Double (double d) |
bool | RawNumber (const Ch *str, SizeType length, bool copy) |
bool | String (const Ch *str, SizeType length, bool copy) |
bool | StartObject () |
bool | Key (const Ch *str, SizeType len, bool copy) |
bool | EndObject (SizeType memberCount) |
bool | StartArray () |
bool | EndArray (SizeType elementCount) |
virtual ISchemaValidator * | CreateSchemaValidator (const SchemaType &root, const bool inheritContinueOnErrors) |
virtual void | DestroySchemaValidator (ISchemaValidator *validator) |
virtual void * | CreateHasher () |
virtual uint64_t | GetHashCode (void *hasher) |
virtual void | DestroryHasher (void *hasher) |
virtual void * | MallocState (size_t size) |
virtual void | FreeState (void *p) |
![]() | |
virtual | ~ISchemaStateFactory () |
virtual void | DestroySchemaValidator (ISchemaValidator *validator)=0 |
![]() | |
virtual | ~ISchemaValidator () |
![]() | |
virtual | ~IValidationErrorHandler () |
virtual void | TooLong (const Ch *str, SizeType length, SizeType expected)=0 |
virtual void | TooShort (const Ch *str, SizeType length, SizeType expected)=0 |
virtual void | DoesNotMatch (const Ch *str, SizeType length)=0 |
virtual void | PropertyViolations (ISchemaValidator **subvalidators, SizeType count)=0 |
virtual void | DisallowedProperty (const Ch *name, SizeType length)=0 |
virtual void | AddDependencySchemaError (const SValue &souceName, ISchemaValidator *subvalidator)=0 |
virtual void | NotAllOf (ISchemaValidator **subvalidators, SizeType count)=0 |
virtual void | NoneOf (ISchemaValidator **subvalidators, SizeType count)=0 |
virtual void | NotOneOf (ISchemaValidator **subvalidators, SizeType count)=0 |
Detailed Description
template<typename SchemaDocumentType, typename OutputHandler = BaseReaderHandler<typename SchemaDocumentType::SchemaType::EncodingType>, typename StateAllocator = CrtAllocator>
class GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >
JSON Schema Validator.
A SAX style JSON schema validator. It uses a GenericSchemaDocument
to validate SAX events. It delegates the incoming SAX events to an output handler. The default output handler does nothing. It can be reused multiple times by calling Reset()
.
- Template Parameters
-
SchemaDocumentType Type of schema document. OutputHandler Type of output handler. Default handler does nothing. StateAllocator Allocator for storing the internal validation states.
Member Typedef Documentation
◆ Ch
typedef EncodingType::Ch GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::Ch |
◆ EncodingType
typedef SchemaType::EncodingType GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::EncodingType |
◆ PointerType
typedef SchemaDocumentType::PointerType GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::PointerType |
◆ SchemaType
typedef SchemaDocumentType::SchemaType GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::SchemaType |
◆ StringRefType
typedef GenericStringRef<Ch> GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::StringRefType |
◆ SValue
typedef SchemaType::SValue GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::SValue |
◆ ValueType
typedef GenericValue<EncodingType, StateAllocator> GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::ValueType |
Constructor & Destructor Documentation
◆ GenericSchemaValidator() [1/2]
|
inline |
Constructor without output handler.
- Parameters
-
schemaDocument The schema document to conform to. allocator Optional allocator for storing internal validation states. schemaStackCapacity Optional initial capacity of schema path stack. documentStackCapacity Optional initial capacity of document path stack.
◆ GenericSchemaValidator() [2/2]
|
inline |
Constructor with output handler.
- Parameters
-
schemaDocument The schema document to conform to. allocator Optional allocator for storing internal validation states. schemaStackCapacity Optional initial capacity of schema path stack. documentStackCapacity Optional initial capacity of document path stack.
◆ ~GenericSchemaValidator()
|
inline |
Destructor.
Member Function Documentation
◆ AboveMaximum() [1/3]
|
inlinevirtual |
◆ AboveMaximum() [2/3]
|
inlinevirtual |
◆ AboveMaximum() [3/3]
|
inlinevirtual |
◆ AddDependencySchemaError()
|
inline |
◆ AddExpectedType()
|
inlinevirtual |
◆ AddMissingDependentProperty()
|
inlinevirtual |
◆ AddMissingProperty()
|
inlinevirtual |
◆ BelowMinimum() [1/3]
|
inlinevirtual |
◆ BelowMinimum() [2/3]
|
inlinevirtual |
◆ BelowMinimum() [3/3]
|
inlinevirtual |
◆ Bool()
|
inline |
◆ CreateHasher()
|
inlinevirtual |
◆ CreateSchemaValidator()
|
inlinevirtual |
◆ DestroryHasher()
|
inlinevirtual |
◆ DestroySchemaValidator()
|
inlinevirtual |
◆ Disallowed()
|
inlinevirtual |
◆ DisallowedItem()
|
inlinevirtual |
◆ DisallowedProperty()
|
inline |
◆ DisallowedValue()
|
inlinevirtual |
◆ DisallowedWhenReading()
|
inlinevirtual |
◆ DisallowedWhenWriting()
|
inlinevirtual |
◆ DoesNotMatch()
|
inline |
◆ Double()
|
inline |
◆ DuplicateItems()
|
inlinevirtual |
◆ EndArray()
|
inline |
◆ EndDependencyErrors()
|
inlinevirtual |
◆ EndDisallowedType()
|
inlinevirtual |
◆ EndMissingDependentProperties()
|
inlinevirtual |
◆ EndMissingProperties()
|
inlinevirtual |
◆ EndObject()
|
inline |
◆ FreeState()
|
inlinevirtual |
◆ GetError() [1/2]
|
inline |
End of Implementation of ISchemaValidator.
Gets the error object.
◆ GetError() [2/2]
|
inline |
◆ GetHashCode()
|
inlinevirtual |
◆ GetInvalidDocumentPointer()
|
inline |
Gets the JSON pointer pointed to the invalid value.
◆ GetInvalidSchemaCode()
|
inline |
Gets the error code of invalid schema.
◆ GetInvalidSchemaKeyword()
|
inline |
Gets the keyword of invalid schema.
◆ GetInvalidSchemaPointer()
|
inline |
Gets the JSON pointer pointed to the invalid schema.
◆ GetValidateFlags()
|
inlinevirtual |
Implements internal::ISchemaValidator.
◆ Int()
|
inline |
◆ Int64()
|
inline |
◆ IsValid()
|
inlinevirtual |
Implements internal::ISchemaValidator.
◆ Key()
|
inline |
◆ MallocState()
|
inlinevirtual |
◆ MultipleOneOf()
|
inlinevirtual |
◆ NoneOf()
|
inline |
◆ NotAllOf()
|
inline |
◆ NotMultipleOf() [1/3]
|
inlinevirtual |
◆ NotMultipleOf() [2/3]
|
inlinevirtual |
◆ NotMultipleOf() [3/3]
|
inlinevirtual |
◆ NotOneOf()
|
inline |
◆ Null()
|
inline |
◆ PropertyViolations()
|
inline |
◆ RawNumber()
|
inline |
◆ Reset()
|
inline |
Reset the internal states.
◆ ResetError()
|
inline |
Reset the error state.
◆ SetValidateFlags()
|
inlinevirtual |
Implementation of ISchemaValidator.
Implements internal::ISchemaValidator.
◆ StartArray()
|
inline |
◆ StartDependencyErrors()
|
inlinevirtual |
◆ StartDisallowedType()
|
inlinevirtual |
◆ StartMissingDependentProperties()
|
inlinevirtual |
◆ StartMissingProperties()
|
inlinevirtual |
◆ StartObject()
|
inline |
◆ String()
|
inline |
◆ TooFewItems()
|
inlinevirtual |
◆ TooFewProperties()
|
inlinevirtual |
◆ TooLong()
|
inline |
◆ TooManyItems()
|
inlinevirtual |
◆ TooManyProperties()
|
inlinevirtual |
◆ TooShort()
|
inline |
◆ Uint()
|
inline |
◆ Uint64()
|
inline |
The documentation for this class was generated from the following files: