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

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ola::web::ValidatorInterface Class Referenceabstract
JSON

## Detailed Description

The interface Json Schema Validators.

Inheritance diagram for ola::web::ValidatorInterface:

## Public Types
typedef std::vector< ValidatorInterface * > | ValidatorList
| a list of Validators.

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

## Member Function Documentation

## ◆ GetDefaultValue()

virtual const JsonValue * ola::web::ValidatorInterface::GetDefaultValue | ( |  | ) | const
| pure 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.

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

## ◆ GetSchema()

virtual JsonObject * ola::web::ValidatorInterface::GetSchema | ( |  | ) | const
| pure virtual

Returns the Schema as a JsonObject.

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

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

## ◆ IsValid()

virtual bool ola::web::ValidatorInterface::IsValid | ( |  | ) | const
| pure virtual

Check if the value was valid according to this validator.

Implemented in ola::web::BaseValidator, ola::web::ReferenceValidator, and ola::web::WildcardValidator.

## ◆ SetDefaultValue()

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

Set the default value for this validator.

Parameters

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

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

## ◆ SetDescription()

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

Set the description property for this validator.

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

## ◆ SetId()

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

Set the id property for this validator.

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

## ◆ SetSchema()

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

Set the $schema property for this validator.

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

## ◆ SetTitle()

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

Set the title property for this validator.

Implemented in ola::web::BaseValidator, and ola::web::ReferenceValidator.

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

- include/ola/web/JsonSchema.h