Open Lighting Architecture  Latest Git
Public Types | Public Member Functions | List of all members
ola::web::ValidatorInterface Class Referenceabstract

Detailed Description

The interface Json Schema Validators.

Inheritance diagram for ola::web::ValidatorInterface:
Inheritance graph
[legend]
Collaboration diagram for ola::web::ValidatorInterface:
Collaboration graph
[legend]

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 JsonObjectGetSchema () const =0
 Returns the Schema as a JsonObject. More...
 
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. More...
 
virtual const JsonValueGetDefaultValue () const =0
 Return the default value for this validator. More...
 
- 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::ReferenceValidator, and ola::web::BaseValidator.

◆ 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::ReferenceValidator, and ola::web::BaseValidator.

◆ SetDefaultValue()

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

Set the default value for this validator.

Parameters
valueThe JsonValue to use as the default. Ownership is transferred.

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


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