Class: BrokenRuleList

bo.rules. BrokenRuleList

Represents the lists of broken rules.

new BrokenRuleList(modelName)

Creates a new broken rule list instance.

Parameters:
Name Type Description
modelName string

The name of the model.

Throws:
Argument error: The model name must be a non-empty string.

Methods

add(brokenRule)

Adds a broken rule to the list.

Parameters:
Name Type Description
brokenRule bo.rules.BrokenRule

A broken rule to add.

Throws:
Argument error: The rule must be a BrokenRule object.

clear(property)

Removes the broken rules of a property except of the retained ones. If property is omitted, all broken rules are removed except of the retained ones.

Parameters:
Name Type Argument Description
property bo.rules.PropertyInfo <optional>

A property definition.

clearAll(property)

Removes the broken rules of a property, including retained ones. If property is omitted, all broken rules are removed.

Parameters:
Name Type Description
property

isValid() → {boolean}

Determines if the model is valid. The model is valid when it has no broken rule with error severity.

Returns:
  • True if the model is valid, otherwise false.
Type
boolean

output(namespace) → {bo.rules.BrokenRulesOutput}

Transforms the broken rules into a format that can be sent to the client.

Parameters:
Name Type Argument Description
namespace string <optional>

The namespace of the message keys when messages are localizable.

Throws:
Argument error: The namespace must be a string.
Returns:

The response object to send.

Type
bo.rules.BrokenRulesOutput

<inner> clearFor(propertyName)

Removes the broken rules of a property except of the retained ones.

Parameters:
Name Type Description
propertyName string

The name of the property that broken rules are deleted of.

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.