Class: BrokenRulesOutput

bo.rules. BrokenRulesOutput

Represents the public format of broken rules. The output object has a property for each model property that has broken rule.

 If the model property is a simple property, i.e. it is defined by
 a data type, then the output property
 is an array. The array elements are rule notice
 objects representing the broken rules.

 If the model property is a child model, then the output property
 is an object as well, whose properties represents model properties
 with broken rules, as described above.

 If the model property is a child collection, then the output property
 is an object as well, whose properties are the indeces of the items of
 the collections. The property name is a number in '00000' format. The
 property value represents the child item, as described above.

new BrokenRulesOutput()

Creates a new broken rules output instance.

Members

<readonly> $count

Returns the count of broken rules.

<readonly> $length

Returns the count of properties that have broken rules.

Methods

add(propertyName, notice)

Adds a rule notice to the response object.

Parameters:
Name Type Description
propertyName string

The name of the property.

notice bo.rules.RuleNotice

The public form of the broken rule.

Throws:

addChild(propertyName, output)

Adds a child response object to the response object.

Parameters:
Name Type Description
propertyName string

The name of the property.

output bo.rules.BrokenRulesOutput

The response object of a child property.

Throws:

addChildren(propertyName, outputs)

Adds child response objects to the response object.

Parameters:
Name Type Description
propertyName string

The name of the property.

outputs Array.<bo.rules.BrokenRulesOutput>

The response objects of a child collection property.

Throws:
  • Argument error: The property name must be a non-empty string.
  • Argument error: The outputs must be an array of BrokenRulesOutput objects or a single BrokenRulesOutput object.
If you find bugs or have feature requests, please let us know.

JavaScript business objects ♦ Copyright © 2014-2016 Logikum, Ltd.
Documentation generated by JSDoc 3.2.2 on 2015. December 31. using the DocStrap template.