Open Lighting Architecture: ola::web::ReferenceValidator Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::web::ReferenceValidator Class Reference
JSON

## Detailed Description

A reference validator holds a pointer to another schema.

Inheritance diagram for ola::web::ReferenceValidator:

## Public Member Functions
| ReferenceValidator (const SchemaDefinitions *definitions, const std::string &schema)
bool | IsValid () const
| Check if the value was valid according to this validator.
void | Visit (const JsonString &value)
void | Visit (const JsonBool &value)
void | Visit (const JsonNull &value)
void | Visit (const JsonRawValue &value)
void | Visit (const JsonObject &value)
void | Visit (const JsonArray &value)
void | Visit (const JsonUInt &value)
void | Visit (const JsonUInt64 &value)
void | Visit (const JsonInt &value)
void | Visit (const JsonInt64 &value)
void | Visit (const JsonDouble &value)
JsonObject * | GetSchema () const
| Returns the Schema as a JsonObject.
void | SetSchema (const std::string &schema)
| Set the $schema property for this validator.
void | SetId (const std::string &id)
| Set the id property for this validator.
void | SetTitle (const std::string &title)
| Set the title property for this validator.
void | SetDescription (const std::string &title)
| Set the description property for this validator.
void | SetDefaultValue (const JsonValue *value)
| Set the default value for this validator.
const JsonValue * | GetDefaultValue () const
| Return the default value for this validator.

## Additional Inherited Members
Public Types inherited from ola::web::ValidatorInterface
typedef std::vector< ValidatorInterface * > | ValidatorList
| a list of Validators.

## Constructor & Destructor Documentation

## ◆ ReferenceValidator()

ola::web::ReferenceValidator::ReferenceValidator | ( | const SchemaDefinitions * | definitions,
|  | const std::string & | schema )

Parameters

  definitions | A SchemaDefinitions object with which to resolve references.
  schema | The $ref link to the other schema.

## Member Function Documentation

## ◆ GetDefaultValue()

const JsonValue * ola::web::ReferenceValidator::GetDefaultValue | ( |  | ) | const
| virtual

Return the default value for this validator.

Returns
  A JsonValue, or NULL if no default value was specified. Ownership is not transferred.

The value is only valid until the next call to SetDefaultValue or for the lifetime of the validator.

Implements ola::web::ValidatorInterface.

## ◆ GetSchema()

JsonObject * ola::web::ReferenceValidator::GetSchema | ( |  | ) | const
| virtual

Returns the Schema as a JsonObject.

Returns
  A new JsonObject that represents the schema. Ownership of the JsonObject is transferred to the caller.

Implements ola::web::ValidatorInterface.

## ◆ IsValid()

bool ola::web::ReferenceValidator::IsValid | ( |  | ) | const
| virtual

Check if the value was valid according to this validator.

Implements ola::web::ValidatorInterface.

## ◆ SetDefaultValue()

void ola::web::ReferenceValidator::SetDefaultValue | ( | const JsonValue * | value | ) |
| virtual

Set the default value for this validator.

Parameters

  value | The JsonValue to use as the default. Ownership is transferred.

Implements ola::web::ValidatorInterface.

## ◆ SetDescription()

void ola::web::ReferenceValidator::SetDescription | ( | const std::string & | title | ) |
| virtual

Set the description property for this validator.

Implements ola::web::ValidatorInterface.

## ◆ SetId()

void ola::web::ReferenceValidator::SetId | ( | const std::string & | id | ) |
| virtual

Set the id property for this validator.

Implements ola::web::ValidatorInterface.

## ◆ SetSchema()

void ola::web::ReferenceValidator::SetSchema | ( | const std::string & | schema | ) |
| virtual

Set the $schema property for this validator.

Implements ola::web::ValidatorInterface.

## ◆ SetTitle()

void ola::web::ReferenceValidator::SetTitle | ( | const std::string & | title | ) |
| virtual

Set the title property for this validator.

Implements ola::web::ValidatorInterface.

## ◆ Visit() [1/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonArray & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [2/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonBool & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [3/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonDouble & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [4/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonInt & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [5/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonInt64 & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [6/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonNull & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [7/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonObject & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [8/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonRawValue & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [9/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonString & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [10/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonUInt & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

## ◆ Visit() [11/11]

void ola::web::ReferenceValidator::Visit | ( | const JsonUInt64 & | value | ) |
| virtual

Implements ola::web::JsonValueConstVisitorInterface.

The documentation for this class was generated from the following files:

- include/ola/web/JsonSchema.h
- common/web/JsonSchema.cpp