Class: ValidatedConcept

composer-common. ValidatedConcept


Resource is an instance that has a type. The type of the resource
specifies a set of properites (which themselves have types).



Type information in Composer is used to validate the structure of
Resource instances and for serialization.



Resources are used in Composer to represent Assets, Participants, Transactions and
other domain classes that can be serialized for long-term persistent storage.


new ValidatedConcept(modelManager, ns, type, resourceValidator)

This constructor should not be called directly.


Note: Only to be called by framework code. Applications should
retrieve instances from Factory

Parameters:
Name Type Description
modelManager ModelManager

The ModelManager for this instance

ns string

The namespace this instance.

type string

The type this instance.

resourceValidator ResourceValidator

The validator to use for this instance

Source:
See:

Extends

  • Identifiable

Methods


addArrayValue(propName, value)

Adds an array property value, validating that it does not violate the model

Parameters:
Name Type Description
propName string

the name of the field

value string

the value of the property

Source:
Throws:

if the value is not compatible with the model definition for the field

Type
Error

setPropertyValue(propName, value)

Sets a property, validating that it does not violate the model

Parameters:
Name Type Description
propName string

the name of the field

value string

the value of the property

Source:
Throws:

if the value is not compatible with the model definition for the field

Type
Error

validate()

Validates the instance against its model.

Source:
Throws:
  • if the instance if invalid with respect to the model
Type
Error