N1 Service Provisioning System 4.1 Reference Guide

The component var Element

The component <var> element is a child of the component <varList> element and is used to declare a component substitution variable including name and default value.

component var Element attributes

Name 

Type 

Required 

Configurable 

Description 

access 

access Enum 

No 

No 

The access mode of the variable, as described below. Default is PUBLIC. 

modifier 

modifier Enum 

No 

No 

The modifier of the variable, as described below. 

name 

identifier 

Yes 

No 

The name of the substitution variable. The name must be unique among every other substitution variable in the enclosing <varList>. 

default 

String 

Yes 1 

Yes 

The default value of the substitution variable, which may include references to other substitution variables, target host attributes, and installed component variables. 

1 May not be included in abstract variables.

var access Attribute

The "access" attribute of the <var> element specifies the accessibility of the variable.

If PUBLIC, access is not restricted in any way.

If PROTECTED, access is limited to derived components and entities in the same path.

If PATH, access is limited to entities in the same path.

If PRIVATE, access is limited to this component.

var modifier Attribute

The "modifier" attribute of the <var> element specifies the override requirements for the variable.

If ABSTRACT, the variable "default" attribute is omitted and must be specified by non-abstract derived components. Variables may only be declared abstract if the component is also declared abstract. Abstract variables may not be private. Non-abstract variables must declare a default value.

If FINAL, the variable may not be overridden by derived components.

If unspecified, then derived components can choose whether or not to override the variable.

var Inheritance and Overriding

By default, a derived component inherits all accessible variables of its base component, including access mode, modifier, and default value.

A derived component may define additional variables by using names that are not among the variables inherited from the base component. A derived component may override the default value, modifier, and access mode of a non-final inherited variable by re-declaring a variable with the same name. When a variable is overridden, the entire content of the variable must be re-declared, including default value, access mode, and modifier. The default value is specified if and only if the overriding variable is non-abstract. The access mode may be no more restrictive than the base component mode.

When a variable is overridden, all references to the variable evaluate to the overridden value, including those in the base component.


Note –

If the derived component is declared as non-abstract, then any abstract variables declared by the base component must be overridden by the derived component.