Open Lighting Architecture  0.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
ola::web::ValidatorInterface Class Reference

Detailed Description

The interface Json Schema Validators.

Inheritance diagram for ola::web::ValidatorInterface:
ola::web::JsonValueConstVisitorInterface ola::web::BaseValidator ola::web::ReferenceValidator ola::web::ArrayValidator ola::web::BoolValidator ola::web::ConjunctionValidator ola::web::IntegerValidator ola::web::NotValidator ola::web::NullValidator ola::web::ObjectValidator ola::web::StringValidator ola::web::WildcardValidator

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.
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 JsonValueGetDefaultValue () 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

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.

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.

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: