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

Class

Component

Component(propsopt)

Class that represents the base of modeling tools.
Constructor

# new Component(propsopt)

Default constructor.
Parameters:
Name Type Attributes Description
props object <optional>
Object that contains all properties to set.
id string <optional>
The id of this Component.
externalId string <optional>
The external id of this Component.
name string <optional>
The name of this Component.
definition ComponentDefinition <optional>
The Definition used to instantiate this Component.
drawOption ComponentDrawOption <optional>
The options used to draw this Component.
attributes Array.<ComponentAttribute> <optional>
Attributes of Component.

View Source models/Component.js, line 10

Extends

Members

Array.<ComponentAttribute>

# attributes

Attributes of Component.
Default Value:
  • []

View Source models/Component.js, line 78

ComponentDefinition

# definition

The Definition used to instantiate this Component.

View Source models/Component.js, line 67

ComponentDrawOption

# drawOption

The options used to draw this Component.

View Source models/Component.js, line 72

string

# externalId

The external id of this Component. This external id is handled by the plugin itself and is not mandatory (defaulted to id).

View Source models/Component.js, line 57

string

# id

The id of this Component. The id is generated by the plugin-core for internal usage and should never be changed.

View Source models/Component.js, line 51

string

# name

The name of this Component.

View Source models/Component.js, line 62

string

# path

Path of the file.
Overrides:
Default Value:
  • null

View Source models/FileInformation.js, line 20

Methods

# canContain(type) → {boolean}

Indicate if component can contain provided component type.
Parameters:
Name Type Description
type string Type of component.

View Source models/Component.js, line 468

True if component can contain type otherwise false.
boolean

# createAttribute(props) → {ComponentAttribute}

Create a new instance of ComponentAttribute with the provided properties.
Parameters:
Name Type Description
props object Properties to initialize the ComponentAttribute with.

View Source models/Component.js, line 163

A new ComponentAttribute instance.

# getAttributeByName(name) → {ComponentAttribute|null}

Get attribute corresponding to the given name.
Parameters:
Name Type Description
name string Name of attribute to find.

View Source models/Component.js, line 283

Component attribute or null.
ComponentAttribute | null

# getAttributesByType(…types) → {Array.<ComponentAttribute>}

Get attributes corresponding to the given type.
Parameters:
Name Type Attributes Description
types string <repeatable>
Type of attribute to find.

View Source models/Component.js, line 355

Component attributes array.
Array.<ComponentAttribute>

# getConfigurationKey() → {string}

Get configuration key of the component. By default, if not overriden by plugin, it will return the component's id.

View Source models/Component.js, line 94

Component's configuration key.
string

# getContainerId() → {string}

Retrieve container id from attributes.

View Source models/Component.js, line 367

Id of container or null.
string

# getDefinedAttributesByType(type) → {Array.<ComponentAttributeDefinition>}

Get defined attributes by type.
Parameters:
Name Type Description
type string Type of attributes to get.

View Source models/Component.js, line 436

- Defined attributes.

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

Set all errors of component.
Parameters:
Name Type Attributes Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.

View Source models/Component.js, line 379

All component errors.
Array.<ParserLog>

# removeAllReferenceAttributes(container)

Remove all reference attributes, corresponding to the container if existing.
Parameters:
Name Type Description
container Component Container.

View Source models/Component.js, line 171

# removeLinkAttribute(id, nameopt)

Remove id in link attribute corresponding to the given name if provided otherwise remove id in all link attributes' value. Then if value is empty remove attribute.
Parameters:
Name Type Attributes Default Description
id string Id to remove.
name string <optional>
null Name of attribute to remove.

View Source models/Component.js, line 250

# setExternalId(value)

Set the external id of this Component with value parameter.
Parameters:
Name Type Description
value string New external id value.

View Source models/Component.js, line 85

# setLinkAttribute(link)

Set the attribute of a given link.
Parameters:
Name Type Description
link ComponentLink The link we want to set the attribute.

View Source models/Component.js, line 186

# setReferenceAttribute(container)

Set container value in attributes.
Parameters:
Name Type Description
container Component Container.

View Source models/Component.js, line 102

# validateDefinition(errorsopt) → {Array.<ParserLog>}

Set error if definition is null.
Parameters:
Name Type Attributes Description
errors Array.<ParserLog> <optional>
Errors to set, can be null.

View Source models/Component.js, line 419

All component errors.
Array.<ParserLog>

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

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

View Source models/Component.js, line 393

All attributes error.
Array.<ParserLog>