Wire Sysio Wire Sysion 1.0.0
|
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 |
Public Types inherited from internal::IValidationErrorHandler< SchemaDocumentType::SchemaType > | |
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. | |
GenericSchemaValidator (const SchemaDocumentType &schemaDocument, OutputHandler &outputHandler, StateAllocator *allocator=0, size_t schemaStackCapacity=kDefaultSchemaStackCapacity, size_t documentStackCapacity=kDefaultDocumentStackCapacity) | |
Constructor with output handler. | |
~GenericSchemaValidator () | |
Destructor. | |
void | Reset () |
Reset the internal states. | |
virtual bool | IsValid () const |
Checks whether the current state is valid. | |
ValueType & | GetError () |
Gets the error object. | |
const ValueType & | GetError () const |
PointerType | GetInvalidSchemaPointer () const |
Gets the JSON pointer pointed to the invalid schema. | |
const Ch * | GetInvalidSchemaKeyword () const |
Gets the keyword of invalid schema. | |
PointerType | GetInvalidDocumentPointer () const |
Gets the JSON pointer pointed to the invalid value. | |
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 () |
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 | Disallowed () |
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) |
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) |
Public Member Functions inherited from internal::ISchemaStateFactory< SchemaDocumentType::SchemaType > | |
virtual | ~ISchemaStateFactory () |
virtual ISchemaValidator * | CreateSchemaValidator (const SchemaType &)=0 |
virtual void | DestroySchemaValidator (ISchemaValidator *validator)=0 |
Public Member Functions inherited from internal::ISchemaValidator | |
virtual | ~ISchemaValidator () |
Public Member Functions inherited from internal::IValidationErrorHandler< SchemaDocumentType::SchemaType > | |
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 |
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()
.
SchemaDocumentType | Type of schema document. |
OutputHandler | Type of output handler. Default handler does nothing. |
StateAllocator | Allocator for storing the internal validation states. |
EncodingType::Ch GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::Ch |
SchemaType::EncodingType GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::EncodingType |
SchemaDocumentType::PointerType GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::PointerType |
SchemaDocumentType::SchemaType GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::SchemaType |
GenericStringRef<Ch> GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::StringRefType |
SchemaType::SValue GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::SValue |
GenericValue<EncodingType, StateAllocator> GenericSchemaValidator< SchemaDocumentType, OutputHandler, StateAllocator >::ValueType |
|
inline |
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. |
Definition at line 1784 of file schema.h.
|
inline |
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. |
Definition at line 1814 of file schema.h.
|
inline |
Definition at line 1839 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1900 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1892 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1896 of file schema.h.
|
inline |
Definition at line 2000 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 2021 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1992 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1964 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1912 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1904 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1908 of file schema.h.
|
inline |
Definition at line 2104 of file schema.h.
|
inlinevirtual |
Implements internal::ISchemaStateFactory< SchemaDocumentType::SchemaType >.
Definition at line 2169 of file schema.h.
|
inlinevirtual |
Definition at line 2155 of file schema.h.
|
inlinevirtual |
Implements internal::ISchemaStateFactory< SchemaDocumentType::SchemaType >.
Definition at line 2177 of file schema.h.
|
inlinevirtual |
Definition at line 2163 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 2042 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1931 of file schema.h.
|
inline |
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 2014 of file schema.h.
|
inline |
|
inline |
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1944 of file schema.h.
|
inline |
Definition at line 2142 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 2004 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 2024 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1995 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1967 of file schema.h.
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inlinevirtual |
Implements internal::ISchemaStateFactory< SchemaDocumentType::SchemaType >.
Definition at line 2173 of file schema.h.
|
inline |
Definition at line 1874 of file schema.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Implements internal::ISchemaValidator.
Definition at line 1857 of file schema.h.
|
inline |
|
inlinevirtual |
Implements internal::ISchemaStateFactory< SchemaDocumentType::SchemaType >.
Definition at line 2183 of file schema.h.
|
inline |
|
inline |
Definition at line 2031 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1889 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1883 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1886 of file schema.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 2110 of file schema.h.
|
inline |
|
inline |
Definition at line 2136 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1986 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 2018 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1989 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1961 of file schema.h.
|
inline |
|
inline |
Definition at line 2112 of file schema.h.
|
inlinevirtual |
Implements internal::IValidationErrorHandler< SchemaDocumentType::SchemaType >.
Definition at line 1936 of file schema.h.
|
inlinevirtual |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |