The <var> element is a child of the <varlist> element, which is a child of the <component> element. The <var> element declares a component substitution variable. You must specify the name of the variable and a default value for each substitution variable that you want to declare.
By default, a derived component inherits all of the accessible variables from its base component, including access mode, modifier, default value, and prompt. The <var> element can appear one or more times in the <varList> element.
A derived component can define additional variables by using names that are not among the variables that have been inherited from the base component. A derived component can override the prompt, default value, modifier, and access mode of a nonfinal inherited variable by re-declaring a variable with the same name. When a variable is overridden, the entire contents of the variable must be re-declared, including prompt, default value, access mode, and modifier. The default value is specified only if the overriding variable is nonabstract. The access mode can 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.
If the derived component is declared as nonabstract, any abstract variables declared by the base component must be overridden by the derived component.
The <var> element has the following attributes:
access – An optional value of type accessEnum, which specifies the accessibility of the variable. This attribute can have the following values:
PUBLIC – Access is not restricted in any way, which is the default.
PROTECTED – Access is limited to derived components and entities that are in the same path.
PATH – Access is limited to entities that are in the same path.
PRIVATE – Access is limited to this component.
modifier – An optional value of type modifierEnum, which specifies the override requirements for the variable. This attribute can have the following values:
ABSTRACT – The variable default attribute is omitted and must be specified by nonabstract derived components. Variables can only be declared as abstract if the component is also declared as abstract. Abstract variables cannot be private. Nonabstract variables must declare a default value.
FINAL – The variable cannot be overridden by derived components.
If the attribute is omitted, derived components can choose whether to override the variable.
name – A required value of type identifier, which is the name of the substitution variable. Each variable name declared by <var> elements in the <varList> element must be unique.
default – A required string for nonabstract variables, which is the default value of the substitution variable. This value can include references to other substitution variables, session variables, target host attributes, and installed component variables. However, an abstract variable cannot define a default value, so this attribute cannot be used for abstract variables.
prompt – An optional string that is a user-readable description of the variable.