tracking-code-which-will-go-to-the-HEAD ComponentAttribute

Class

ComponentAttribute

ComponentAttribute(propsopt)

Class to add Attribute in Components.
Constructor

# new ComponentAttribute(propsopt)

Default constructor.
Parameters:
Name Type Attributes Description
props object <optional>
Object that contains all properties to set.
name string <optional>
The name of the attribute.
value string | boolean | number | Array | Array.<ComponentAttribute> <optional>
The value of the attribute.
type string <optional>
The real type of the attribute, valid types are String/Boolean/Number/Array/Object.
definition ComponentAttributeDefinition <optional>
The definition of the attribute.

View Source models/ComponentAttribute.js, line 6

Members

ComponentAttributeDefinition

# definition

The definition of the attribute.

View Source models/ComponentAttribute.js, line 51

# isVariable

Check if the attribute is a variable.

View Source models/ComponentAttribute.js, line 58

string

# name

The name of the attribute.

View Source models/ComponentAttribute.js, line 35

string

# type

The type of the attribute, real type of the attribute, to check if it matches with the ComponentAttributeDefinition.

View Source models/ComponentAttribute.js, line 46

string | boolean | number | Array | Array.<ComponentAttribute>

# value

The value of the attribute.

View Source models/ComponentAttribute.js, line 40

Methods

# getErrors(errorsopt, recurseopt, idopt) → {Array.<ParserLog>}

Get all errors of the attribute.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
recurse boolean <optional>
false If true, get sub-attributes errors recursively.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 69

All attributes error.
Array.<ParserLog>

# validateDefinitionType(errorsopt, idopt) → {Array.<ParserLog>}

Set if definition type is according to type.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 90

All attributes error.
Array.<ParserLog>

# validateRequiredAttributes(errorsopt, idopt) → {Array.<ParserLog>}

Set error if the required attribute is not present or if its value is null.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 293

All attributes error.
Array.<ParserLog>

# validateRuleMinMax(errorsopt, idopt) → {Array.<ParserLog>}

Set error if : - Value is a string or array and its length is less than the specify minimum length. - Value is a string or array and its length is greater than the specify maximum length. - Value is a number and its value is less than the specify minimum value. - Value is a number and its value is greater than the specify maximum value.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 203

All attributes error.
Array.<ParserLog>

# validateRuleRegex(errorsopt, idopt) → {Array.<ParserLog>}

Set error if value is not null and not match the specify regex.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 268

All attributes error.
Array.<ParserLog>

# validateRuleValues(errorsopt, idopt) → {Array.<ParserLog>}

Set error if value or all elements of value array is not included in the specify values.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 241

All attributes error.
Array.<ParserLog>

# validateType(errorsopt, idopt) → {Array.<ParserLog>}

Set if type is according to type of value.
Parameters:
Name Type Attributes Default Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.
id string <optional>
null Component id.

View Source models/ComponentAttribute.js, line 137

All attributes error.
Array.<ParserLog>