Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
ola::web::ReferenceValidator Class Reference

Detailed Description

A reference validator holds a pointer to another schema.

Inheritance diagram for ola::web::ReferenceValidator:
ola::web::ValidatorInterface ola::web::JsonValueConstVisitorInterface

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)
 
JsonObjectGetSchema () 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 JsonValueGetDefaultValue () const
 Return the default value for this validator.
 
- Public Member Functions inherited from ola::web::ValidatorInterface
- Public Member Functions inherited from ola::web::JsonValueConstVisitorInterface

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
definitionsA SchemaDefinitions object with which to resolve references.
schemaThe $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
valueThe 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

◆ Visit() [2/11]

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

◆ Visit() [3/11]

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

◆ Visit() [4/11]

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

◆ Visit() [5/11]

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

◆ Visit() [6/11]

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

◆ Visit() [7/11]

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

◆ Visit() [8/11]

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

◆ Visit() [9/11]

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

◆ Visit() [10/11]

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

◆ Visit() [11/11]

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

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