Open Lighting Architecture  0.9.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
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.

Additional Inherited Members

- Public Types inherited from ola::web::ValidatorInterface
typedef std::vector
< ValidatorInterface * > 
ValidatorList
 a list of Validators.

Constructor & Destructor Documentation

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

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.

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.

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.


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